Skip to content

nintha/tcphole

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

TcpHole

本项目基于nodejs实现,可以把内网主机上的一个tcp端口映射到公网主机上。

使用环境

  • 公网主机 :hole-server.js
  • 内网主机 :hole-client.js

流程示意图

+-----------+      +-----------+       +-----------+    +----------+
|           |      |           |       |           |    |          |
|Web Browser|      |PUBLIC HOST|       | LOCAL HOST|    |Web Serser|
|           |      |           |       |           |    |   8080   |
|           +------>8080   8090<-------+           +---->          |
|           |      |           |       |           |    |          |
|           |      |hole-server|       |hole-client|    |          |
|           |      |           |       |           |    |          |
+-----------+      +-----------+       +-----------+    +----------+

在公网机器上启动hole-server.js,在本地机器上先设置公网机器的IP(OUT_SERVER_IP属性),再启动hole-client.js

hole-server默认监听80808090端口,hole-client默认会去访问公网机器8090端口和本地的8080端口。然后你可以通过访问公网机器的8080端口浏览本地的网站了。

About

port mapping for local app

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published