Created
October 8, 2013 17:02
-
-
Save bodokaiser/6887894 to your computer and use it in GitHub Desktop.
Reproduction of 3G WebSocket proxy bug. See too: http://stackoverflow.com/questions/5574385/websockets-on-ios
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This will work as it should when testing over WiFi. | |
* However if you test this through 3G (or another proxy?) then we fail... | |
*/ | |
var ws = new WebSocket('ws://yourdomain'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require('http'); | |
var server = http.createServer(); | |
server.addListener('request', function(request, response) { | |
console.log(request.headers); | |
response.end(); | |
}); | |
server.addListener('upgrade', function(request, response) { | |
console.log(request.headers); | |
response.end(); | |
}); | |
server.listen(80); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment