mirror of
https://github.com/mclueppers/xo-server.git
synced 2025-07-20 04:24:46 +02:00
Minor fixes in the WebSocket-TCP proxy.
This commit is contained in:
parent
f4d7ce72c2
commit
cbd0b91d6b
@ -99,7 +99,7 @@ xo.on('started', function () {
|
||||
});
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Websocket-TCP proxy (used for consoles).
|
||||
// WebSocket to TCP proxy (used for consoles).
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Protocol:
|
||||
@ -138,7 +138,7 @@ xo.on('started', function () {
|
||||
return;
|
||||
}
|
||||
|
||||
var target = tcp.createConnection(message.host, message.port);
|
||||
var target = tcp.createConnection(message.port, message.host);
|
||||
target.on('data', function (data) {
|
||||
socket.send(data.toString('base64'));
|
||||
});
|
||||
@ -150,7 +150,7 @@ xo.on('started', function () {
|
||||
});
|
||||
|
||||
socket.on('message', function (message) {
|
||||
target.send(new Buffer(message, 'base64'));
|
||||
target.write(new Buffer(message, 'base64'));
|
||||
});
|
||||
socket.on('close', function () {
|
||||
target.end();
|
||||
|
Loading…
x
Reference in New Issue
Block a user