-

   rss_rss_hh_new

 - e-mail

 

 -

 LiveInternet.ru:
: 17.03.2011
:
:
: 51

:


[ ] NAT Node.JS

, 11 2017 . 16:23 +
! , Node.JS!

? , , , , ssh, rdp, http(s), proxy, vnc, .. , , IP .
image

, 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.

image

, 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

image

  1. host:port
    . SSH , , , ssh .



Server

  • ,
  • ,
  • ,

, , , , . ! :

  1. ,
  2. ,
  3. ,
    data .

Agent

, host:port. .

Client

( N_T_CLIENT_PORT). .

!

image

.

, , , , , .

-> Github

, through2.

, , , , , :)

..
. .

...
- Node. ssh, rdp, proxy, vnc :)
Original source: habrahabr.ru (comments, light).

https://habrahabr.ru/post/332876/

:  

: [1] []
 

:
: 

: ( )

:

  URL