GithubHelp home page GithubHelp logo

wareyang / apprtc-go Goto Github PK

View Code? Open in Web Editor NEW

This project forked from daozhao/apprtc-go

0.0 1.0 0.0 211 KB

apprtc demo with golang.It's rewrite project WebRTC(https://github.com/webrtc/apprtc) with golang

License: BSD 3-Clause "New" or "Revised" License

Go 13.26% JavaScript 81.71% CSS 1.38% HTML 3.65%

apprtc-go's Introduction

apprtc-go

apprtc demo with golang. It's rewrite project WebRTC(https://github.com/webrtc/apprtc) with golang

How to run.

  1. Setup the STUN/TURN server and run. coturn[https://github.com/coturn/coturn]
turnserver -v  --user=daozhao --realm apprtc --static-auth-secret=654321 
  1. Install apprtc-go and run.
go get github.com/daozhao/apprtc-go
cd $GOPATH/src/github.com/daozhao/apprtc-go/
go build -o apprtc-go apprtc.go
./apprtc-go -cert=$GOPATH/src/github.com/daozhao/apprtc-go/mycert.pem \
            -key=$GOPATH/src/github.com/daozhao/apprtc-go/mycert.key \
            -stun=192.168.2.170:3478 \
            -turn=192.168.2.170:3478 -turn-username=daozhao -turn-static-auth-secret=654321 \
            -httpport=8080 -httpsport=8888

Open chrome and enter URL(https://XXX.XXX.XXX.XXX:8888 or https://XXX.XXX.XXX.XXX:8080 ).

warnning:Replace the IP(XXX.XXX.XXX.XXX) with your real IP address.

Other test

  1. Only test stun
turnserver --no-auth --stun-only -v
./apprtc-go -cert=$GOPATH/src/github.com/daozhao/apprtc-go/mycert.pem \
                      -key=$GOPATH/src/github.com/daozhao/apprtc-go/mycert.key  \
                      -httpport=8080 -httpsport=8888 \
                      -stun=192.168.2.170:3478 
  1. Test turn with static username and password
turnserver -v  --user=daozhao:12345 --realm apprtc  --no-stun
./apprtc-go -cert=$GOPATH/src/github.com/daozhao/apprtc-go/mycert.pem \
            -key=$GOPATH/src/github.com/daozhao/apprtc-go/mycert.key \
            -httpport=8080 -httpsport=8888 \
            -turn=192.168.2.170:3478 -turn-username=daozhao -turn-password=12345 
  1. Test turn with auth-secret
turnserver -v  --user=daozhao  --realm apprtc --static-auth-secret=654321  --no-stun
./apprtc-go -cert=$GOPATH/src/github.com/daozhao/apprtc-go/mycert.pem \
            -key=$GOPATH/src/github.com/daozhao/apprtc-go/mycert.key \
            -httpport=8080 -httpsport=8888 \
            -turn=192.168.2.170:3478 -turn-username=daozhao -turn-static-auth-secret=654321 

warnning:Please put two devices in different networks so that they cannot access each other.

Help

$GOPATH/bin/apprtc-go --help
Usage of /home/daozhao/Documents/SourceCode/goPath/bin/apprtc-go:
  -cert string
    	cert pem file  (default "./mycert.pem")
  -httpport int
    	The http port that the server listens on (default 8080)
  -httpsport int
    	The https port that the server listens on (default 8888)
  -key string
    	cert key file  (default "./mycert.key")
  -room-server string
    	The origin of the room server (default "https://appr.tc")
  -stun string
    	Enter stun server ip:port,for example 192.168.2.170:3478,default is null
  -turn string
    	Enter turn server ip:port,for example 192.168.2.170:3478,default is null
  -turn-password string
    	Enter turn server user password,default is null
  -turn-static-auth-secret string
    	Enter turn server static auth secret,default is null
  -turn-username string
    	Enter turn server username,default is null

apprtc-go's People

Contributors

daozhao avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.