Giter Site home page Giter Site logo

Comments (6)

rankaiyx avatar rankaiyx commented on July 23, 2024 1

实测了一下 配合socat 可以转发ssh 命令如下
先运行
socat TCP4-LISTEN:27022,reuseaddr,reuseport,fork TCP4:127.0.0.1:8022
再运行
python natter.py -v 27022
然后通过外网ip端口就可以访问到本地的8022的ssh了

环境 termux on Android7.1 Linux 3.10.104
电信光猫桥接 路由器拨号 NAT1 DMZ到Android设备

from natter.

MikeWang000000 avatar MikeWang000000 commented on July 23, 2024

是的,socat 默认不允许端口重用。

可以尝试使用类似 tcp-listen:2081,reuseaddr,reuseport,fork 的参数,但不一定有用。

用户级的端口转发有以下缺点:

  1. 较为耗费资源,如CPU使用率;
  2. 目标端口服务获取到的IP地址永远为127.0.0.1
  3. 可能不支持端口重用,导致无法打洞。

因此,能使用防火墙的端口转发,就不用折腾其他转发了。

(暂时还没有写插件的打算,希望有luci大神帮个忙)

from natter.

peaceanddemocracy avatar peaceanddemocracy commented on July 23, 2024

socat似乎在iptables的下一层,我一开始也是进入误区,测试发现应用层的转发似乎是不行的,必须在网络层直接转发端口。

from natter.

rankaiyx avatar rankaiyx commented on July 23, 2024

但是很多情况没有办法操作iptables 比如没有root的安卓设备 在这种情况下 集成一个应用级的端口转发功能 应该是很好的

另外 不知是feature 还是bug 似乎-t的http服务只能连接一次 比如用手机作为客户端,用手机流量连接好后 关闭流量 再开启流量 再访问 就无法成功

from natter.

guaguaya66 avatar guaguaya66 commented on July 23, 2024

但是很多情况没有办法操作iptables 比如没有root的安卓设备 在这种情况下 集成一个应用级的端口转发功能 应该是很好的

另外 不知是feature 还是bug 似乎-t的http服务只能连接一次 比如用手机作为客户端,用手机流量连接好后 关闭流量 再开启流量 再访问 就无法成功

我也发现了,还以为我打洞失败了

from natter.

MikeWang000000 avatar MikeWang000000 commented on July 23, 2024

是bug (。 ́︿ ̀。)
在修了在修了

目前还没有版本号,只能算是个玩具

from natter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.