Add context to HTTP handlers, attempt to support localhost Broker.

Seems unlikely to work due to dev_appserver single inflight request limitation
This commit is contained in:
Serene Han 2016-02-12 15:38:28 -08:00
parent 4acff9983c
commit b04d1f67fb
4 changed files with 110 additions and 35 deletions

View file

@ -28,7 +28,8 @@ class Broker
@clients = 0
@id = genSnowflakeID()
# Ensure url has the right protocol + trailing slash.
@url = 'https://' + @url if 0 != @url.indexOf('https://', 0)
@url = 'http://' + @url if 0 == @url.indexOf('localhost', 0)
@url = 'https://' + @url if 0 != @url.indexOf('http', 0)
@url += '/' if '/' != @url.substr -1
# Promises some client SDP Offer.