Created
February 28, 2015 15:38
-
-
Save roblabla/26b99e843597d8fc970c to your computer and use it in GitHub Desktop.
HTTP proxy
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
var Http = require('http'); | |
var proxy = { | |
address: '192.168.1.1', | |
port: 80 | |
} | |
var server = { | |
host: "cmc.im", | |
port: 25565 | |
} | |
var req = Http.request({ | |
host: proxy.address, | |
port: proxy.port, | |
method: 'CONNECT', | |
path: server.host + ":" + server.port, | |
}); | |
req.on('connect', function (res, socket, head) { | |
// Now send socket to self.setSocket | |
}); | |
req.end(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment