hole hole

agolangf2016-09-07 16:07:37 • 1422 次点击    
这是一个分享于 2016-09-07 16:07:37 的项目,其中的信息可能已经有所发展或是发生改变。

在其他地方想要访问家里的 raspberry pi, 通常是要在路由器上设置端口转发,然后绑定个动态域名。万一这个路由器不是自己的,自己没有任何权限,这样子旧束手无策了。

不过也是有解决方案的,用 ssh 的端口转发 ssh -CfNgR remote-port:localhost:local-port user@remote。

hole 是另一种解决方案,通过 hole 你可以把 raspberry pi(其他机器也是可以的) 的任何端口转发到公网服务器上面去,这样子你就可以通过访问公网的 服务器来访问家里的服务了。

# A IP is 192.168.1.101
# B IP is 120.26.120.168
# C IP is 172.17.3.10

# Now on B server
holed -addr=tcp://120.26.120.168:4000

# On C server
hole -addr=tcp://120.26.120.168:4000 -src=tcp://127.0.0.1:22

# On A server
ssh root@120.26.120.168 -p 4000

# Now A can visit C via B server
Latest commit to the master branch on 3-22-2017
Download as zip
授权协议:
GPL
开发语言:
Google Go 查看源码»
操作系统:
Linux
1422 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传