Giter VIP home page Giter VIP logo

nat_traversal's Introduction

内网穿透工具

原理

原理

使用

客户端

python run_client.py -c config_c.json

服务端

python run_server.py -c config_s.json

示例, 通过 SSH 访问内网机器

假设公网机器的ip是 192.168.9.224

1. 在公网机器上配置config_s.json, 设置连接密码, 接受客户端配置的端口和websocket路径

{
  "port": 18888,
  "password": "helloworld",
  "path": "/websocket_path"
}

然后启动: python run_server.py -c config_s.json

2. 在需要被访问的内网电脑上配置config_c.json

配置config_c.json

{
  "server": {
    "port": 18888,
    "host": "192.168.9.224",
    "https": false,
    "password": "helloworld",
    "path": "/websocket_path"
  },
  "client": [
    {
      "name": "ssh1",
      "remote_port": 12222,
      "local_port": 22,
      "local_ip": "127.0.0.1"
    }
  ]
}

然后启动: python run_client.py -c config_c.json

3. ssh 连接:

ssh -oPort=12222 [email protected]

nat_traversal's People

Contributors

sazima avatar

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.