Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proxy source code missing ? #2

Open
scramatte opened this issue Oct 14, 2010 · 4 comments
Open

Proxy source code missing ? #2

scramatte opened this issue Oct 14, 2010 · 4 comments

Comments

@scramatte
Copy link

Hi,

Can you submit the proxy source code too ?

@tucano
Copy link

tucano commented Oct 5, 2011

var sys = require("util");
var net = require("net");

process.on("uncaughtException", function(err) {
    sys.puts("exception");
    sys.puts(err);
});

if (process.argv.length != 5) {
    sys.puts("Require the following command line arguments:" +
        " proxy_port service_port service_host");
    sys.puts(" e.g. 9001 80 www.google.com");
    process.exit();
}

var proxyPort = process.argv[2];
var servicePort = process.argv[3];
var serviceHost = process.argv[4];

net.createServer(function (proxySocket) {
    var serviceSocket = new net.Socket();
    serviceSocket.connect(servicePort, serviceHost);

    proxySocket.on("data", function (data) {
        serviceSocket.write(data);
    });
    serviceSocket.on("data", function(data) {
        proxySocket.write(data);
    });

    proxySocket.on("close", function(had_error) {
        serviceSocket.end();
    });
    serviceSocket.on("close", function(had_error) {
        proxySocket.end();
    });
}).listen(proxyPort);

@gumidek
Copy link

gumidek commented Feb 22, 2012

Hi
But this is only proxy server. Can you post source code for proxy telnet server for this project?
Thanx

@psrustik
Copy link

Up

@ignatius333
Copy link

I'm having problems getting JsTerm working. I see someone posted the proxy code.. problem is, I don't know where to put it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants