, 11 2017 . 16:23
+
! , Node.JS!
? , , , , ssh, rdp, http(s), proxy, vnc, .. , , IP .
, IP.
? , , , 3000,
, , 22. ssh localhost:3000, .
? :
github.com/mgrybyk/node-tunnel npm :
cd node-tunnel
npm install
:
node server
:
node client
.env, :
N_T_AGENT_DATA_HOST=localhost
N_T_AGENT_DATA_PORT=22
node agent
, :
ssh -p 8000 localhost
ssh !
( ) server, client agent , localhost:8000 ssh . localhost ; ssh TCP , , http(s)
, ,
IP? , , ,
AWS.
, rdp .
.
.env , Windows PC :
N_T_SERVER_HOST= IP
N_T_AGENT_DATA_HOST=Windows PC
N_T_AGENT_DATA_PORT=3389
N_T_AGENT_NAME=test-rdp
:
node agent
IP
node server
npm.
.env , , :
N_T_SERVER_HOST= IP
N_T_CLIENT_NAME=test-rdp
N_T_CLIENT_PORT=3388
node client
. ! RDP localhost:3388 rdp .
?
, ( .env) . , rdp .
.env
, .env.ssh, .env.rdp, .env.proxy .., agent/client/server , :
node client .env.rdp
, ,
.
Net,
TCP.
, . .
, .
, , , .
. pipe':
agentSocket.pipe(clientSocket)
clientSocket.pipe(agentSocket)
ssh
-
-
-
- host:port
. SSH , , , ssh .
Server
, , , , . ! :
- ,
- ,
-
- ,
data .
Agent
, host:port. .
Client
( N_T_CLIENT_PORT). .
!
.
, , , , , .
->
Github
.. . .
...
- Node. ssh, rdp, proxy, vnc :)
https://habrahabr.ru/post/332876/
:
author xlenz
node.js
forwarding
tunneling