LoveLxr
LoveLxr

Reputation: 411

Response from Turn Server in REST API mode

I have established rfc5766-turnserver and tested success in web browser. IP:192.168.1.111, port:3478. Now I want to get JSON response from server.

in here says the request format should be like

GET /?service=turn&username=mbzrxpgjys

and response should be JSON like

{
     "username" : "12334939:mbzrxpgjys",
     "password" : "adfsaflsjfldssia",
     "ttl" : 86400,
     "uris" : [
       "turn:1.2.3.4:9991?transport=udp",
       "turn:1.2.3.4:9992?transport=tcp",
       "turns:1.2.3.4:443?transport=tcp"
     ]
}

in WebRTC demo Apprtc, file constans.py make the configuration:

TURN_BASE_URL="http://192.168.1.111"

TURN_URL_TEMPLATE="%s/turn.php?username=%s&key=%s"

CEOD_KEY="4080218913"

when the application send a request:"http://192.168.1.111/turn.php?username=xxx&key=4080218913"

nothing returned but a 404 error. if I changed the request as "http://192.168.1.111:3478/turn.php?username=xxx&key=4080218913" I get a html response not a JSON. So I want to know where is the problem? the configuration error or request format?

Sorry for such naive question but it does confused me many days.

Thanks

Upvotes: 0

Views: 950

Answers (0)

Related Questions