安裝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 #啟動(dòng)
$ 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.reibang.com/p/7fd28c26a2cb
在 AppRTC 目錄下執(zhí)行啟動(dòng)命令
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ā)端口號(hào)范圍
min-port=59000
max-port=65000
#Verbose
fingerprint
#webrtc需要使用此選項(xiàng)
lt-cred-mech
use-auth-secret
static-auth-secret=4080218913
#之前turnadmin中-r參數(shù)的值,此處要對(duì)應(yīng)
realm=qiniu
#stale-nonce=600
#max-allocate-lifetime=3000
#可以添加用戶名和密碼
user=test:test
#測(cè)試期間可以使用example/etc中的pem,自己計(jì)算的話需要用到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
#各項(xiàng)參數(shù)含義,可以看turnserver.conf中的說(shuō)明望侈。
turn server
參考
http://www.reibang.com/p/8bb8c548d54a
https://my.oschina.net/andywang1988/blog/848645
turnserver start