Created
July 11, 2011 09:14
-
-
Save fjakobs/1075579 to your computer and use it in GitHub Desktop.
test case for https://github.com/nodejitsu/node-http-proxy/issues/70
This file contains 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
//npm install http-proxy socket.io@0.6.17 | |
var server = require("http").createServer(function(req, res) { | |
res.writeHead(200, {"content-type": "text/html"}); | |
res.end("<html><body><script src='/socket.io/socket.io.js'></script>\ | |
<script>\ | |
var socket = new io.Socket(null, {transports: ['xhr-multipart']});\ | |
socket.connect();\ | |
</script></body></html>"); | |
}) | |
server.listen(6666); | |
var io = require('socket.io').listen(server); | |
io.on('connection', function(client){ | |
console.log("connect", client.sessionId); | |
client.on('disconnect', function(){ | |
console.log("disconnect", client.sessionId); | |
}); | |
}); | |
var httpProxy = require('http-proxy'); | |
httpProxy.createServer(6666, 'localhost').listen(6060); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment