mac運行appRtc

安裝privoxy:

$ brew install privoxy

/usr/local/etc/privoxy/config 下配置:

forward-socks5 /127.0.0.1:1080.

listen-address0.0.0.0:8118

forward192.168.*.*/ .

forward 10.*.*.*/.

forward127.*.*.*/ .

forward 172.*.*.*/.

forward git.meiyou.im/ .

forward ci.meiyou.im/ .

設(shè)置


sudo /usr/local/sbin/privoxy /usr/local/etc/privoxy/config

alias setss="export http_proxy=127.0.0.1:8118&&export https_proxy=127.0.0.1:8118"

alias unsetss="unset http_proxy&&unset https_proxy"


$ setss #啟動

$ unsetss? #停止

配置git代理

git config --global https.proxy 'socks5://127.0.0.1:1080'

git config --global http.proxy 'socks5://127.0.0.1:1080'

取消設(shè)置git代理

git config --global --unset http.proxy

git config --global --unset https.proxy

xcode project

https://blog.piasy.com/2018/08/14/build-webrtc/

?gn gen out/Release-universal --args='target_os="ios" target_cpu="arm64" is_component_build=false is_debug=true ios_enable_code_signing=true' --ide=xcode

src/examples/BUILD.gn中,搜ios_app_bundle("AppRTCMobile"),增加:

extra_substitutions = [

? ? ? ? "PRODUCT_BUNDLE_IDENTIFIER=com.github.AppRTCMobile。。。",

? ? ? ]

src/sdk/build.gn中搜ios_framework_bundle_with_umbrella_header("framework_objc") ,增加

extra_substitutions = [

? ? ? ? "PRODUCT_BUNDLE_IDENTIFIER=org.webrtc.WebRTC。。。。。",

? ? ? ? ? ]

Edit the file src/examples/objc/AppRTCMobile/ios/Info.plistand change the valuecom.google.AppRTCMobile with your own bundle identifier.

Edit the filesrc/sdk/objc/Framework/Info.plist and change the valueorg.webrtc.WebRTCwith your own bundle identifier


Room_Server

參考http://www.itdecent.cn/p/7fd28c26a2cb

在 AppRTC 目錄下執(zhí)行啟動命令

apprtc.py 修改地址

constant.py

TURN_BASE_URL = 'http://192.168.106.67'
TURN_URL_TEMPLATE = '%s/turn?username=zl&key=123456'
ICE_SERVER_BASE_URL = 'http://192.168.106.67'
ICE_SERVER_URL_TEMPLATE = '%s/v1alpha/iceconfig?key=%s'
ICE_SERVER_API_KEY = os.environ.get('ICE_SERVER_API_KEY')

# Dictionary keys in the collider instance info constant.
WSS_INSTANCE_HOST_KEY = '192.168.106.67:8089'
WSS_INSTANCE_NAME_KEY = 'zl'
WSS_INSTANCE_ZONE_KEY = '123456'
WSS_INSTANCES = [{
??? WSS_INSTANCE_HOST_KEY: '192.168.106.67:8089',
??? WSS_INSTANCE_NAME_KEY: 'zl',
??? WSS_INSTANCE_ZONE_KEY: '123456'
}, {
??? WSS_INSTANCE_HOST_KEY: '192.168.106.67:8089',
??? WSS_INSTANCE_NAME_KEY: 'zl',
??? WSS_INSTANCE_ZONE_KEY: '123456'
}]

WSS_HOST_PORT_PAIRS = [ins[WSS_INSTANCE_HOST_KEY] for ins in WSS_INSTANCES]

# memcache key for the active collider host.
WSS_HOST_ACTIVE_HOST_KEY = 'wss_host_active_host'

# Dictionary keys in the collider probing result.
WSS_HOST_IS_UP_KEY = 'is_up'
WSS_HOST_STATUS_CODE_KEY = 'status_code'
WSS_HOST_ERROR_MESSAGE_KEY = 'error_message'

RESPONSE_ERROR = 'ERROR'
RESPONSE_ROOM_FULL = 'FULL'
RESPONSE_UNKNOWN_ROOM = 'UNKNOWN_ROOM'
RESPONSE_UNKNOWN_CLIENT = 'UNKNOWN_CLIENT'
RESPONSE_DUPLICATE_CLIENT = 'DUPLICATE_CLIENT'
RESPONSE_SUCCESS = 'SUCCESS'
RESPONSE_INVALID_REQUEST = 'INVALID_REQUEST'

IS_DEV_SERVER = os.environ.get('APPLICATION_ID', '').startswith('dev')

BIGQUERY_URL = 'https://www.googleapis.com/auth/bigquery'

# Dataset used in production.
BIGQUERY_DATASET_PROD = 'prod'

# Dataset used when running locally.
BIGQUERY_DATASET_LOCAL = 'dev'

# BigQuery table within the dataset.
BIGQUERY_TABLE = 'analytics'

dev_appserver.py -–host=0.0.0.0. out/app_engine

room-server=http://192.168.106.44:8080 地址寫入ARDAppEngineClient.m

信令服務(wù)器

apprtc/src/collider/collidermain/main.go修改地址

go install collidermain

$GOPATH/bin/collidermain -port=8089 -tls=false

生成key:

turnadmin -a?-u test -r rtc.whenchat.com -p test?

? turnadmin -k -u test -r rtc.whenchat.com -p test

?sudo openssl req -x509 -newkey ?rsa:2048?-keyout /etc/turn_server_pkey.pem\

???? ????????????-out /etc/turn_server_cert.pem -days 99999 -nodes

修改turnserver.conf

listening-device=wlxe840f236118e
listening-port=3478
relay-device=wlxe840f236118e
#轉(zhuǎn)發(fā)端口號范圍
min-port=59000
max-port=65000
#Verbose
fingerprint
#webrtc需要使用此選項
lt-cred-mech
use-auth-secret
static-auth-secret=4080218913
#之前turnadmin中-r參數(shù)的值,此處要對應(yīng)
realm=qiniu
#stale-nonce=600
#max-allocate-lifetime=3000
#可以添加用戶名和密碼
user=test:test
#測試期間可以使用example/etc中的pem,自己計算的話需要用到openssl,方法為:
#sudo openssl req -x509 -newkey rsa:2048 -keyout /etc/turn_server_pkey.pem -out /etc/turn_server_cert.pem -days 99999 -nodes

#填寫pem目錄即可,如
#cert=~/OpenSource/coturn/example/etc/turn_server_cert.pem
#pkey==$HOME/OpenSource/coturn/example/etc/turn_server_pkey.pem
# Certificate file.
# Use an absolute path or path relative to the
# configuration file.
#
cert=/Users/zl/Documents/webrtc_server/turnserver-4.5.0.8/bin/turn_server_cert.pem

# Private key file.
# Use an absolute path or path relative to the
# configuration file.
# Use PEM file format.
#
pkey=/Users/zl/Documents/webrtc_server/turnserver-4.5.0.8/bin/turn_server_pkey.pem

no-loopback-peers
no-multicast-peers
mobility
no-cli
#各項參數(shù)含義,可以看turnserver.conf中的說明。


turn server

參考

http://www.itdecent.cn/p/8bb8c548d54a

https://my.oschina.net/andywang1988/blog/848645

turnserver start

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • Spring Cloud為開發(fā)人員提供了快速構(gòu)建分布式系統(tǒng)中一些常見模式的工具(例如配置管理,服務(wù)發(fā)現(xiàn),斷路器,智...
    卡卡羅2017閱讀 136,680評論 19 139
  • git常用命令 GIT常用命令備忘:http://stormzhang.com/git/2014/01/27/gi...
    新篇章閱讀 8,881評論 1 26
  • 文|清心 昨天中午,我舉著太陽傘,剛走進(jìn)小區(qū),看到一只很漂亮的貓,對著我走來的方向蹲坐著。一身黃棕色的貓,細(xì)細(xì)軟軟...
    清心傾心閱讀 967評論 8 14
  • 微博從申請到現(xiàn)在ID都沒換過, 達(dá)浪打啦,是那首愛要坦蕩蕩的前奏 換了ID,碎冰蘑菇凍,脆冰芒果凍,脆冰芒果,脆冰...
    達(dá)浪打啦閱讀 150評論 0 0
  • 說是一千個人,其實夸大了。 最近在看泰戈爾的飛鳥集。我面前有三個版本:英文版,主流的翻譯版,和馮唐的翻譯版。 也知...
    一二一二呀閱讀 250評論 0 0

友情鏈接更多精彩內(nèi)容