Skip to main content

No project description provided

Project description

中文

ProxyNT is a reverse proxy server that can expose a local server to the internet through NATs and firewalls

Principle

原理

Features

  • Easily manage port forwarding from anywhere via a browser
  • Uses WebSocket encryption for secure communication between the public server and local client
  • Easy to install with pip.
  • Stable, automatically reconnects, and has been used in production environments

Common Use Cases

  1. Host web servers from home
  2. Manage IoT devices

Installation

pip install proxynt

Usage

Client

nt_client --help
# start client
nt_client -c config_c.json

Server

# view help
nt_server --help
# start server
nt_server -c config_s.json

After starting the server, open the management page in a browser:

Copy code
The management page URL is the WebSocket path plus /admin,
for example:
http://192.168.9.224:18888/websocket_path/admin

ui

Example: Accessing an Internal Network Machine via SSH

Suppose the public server's IP is 192.168.9.224.

1. Configure config_s.json on the public server

{
  "port": 18888,
  "password": "helloworld",
  "path": "/websocket_path",
  "admin": {
    "enable": true,  
    "admin_password": "new_password"  
  }
}

Explanation:

  • port: listening port
  • password: connection password
  • path: WebSocket path
  • admin: management page configuration (not required)
  • admin.enable: whether to enable the management page
  • admin.admin_password: management password

Then start the server with:

nt_server -c config_s.json

2. Configure config_c.json on the machine to be accessed

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

Explanation:

  • server: configuration for the server to connect to, including port, IP address, whether to use HTTPS, password, and WebSocket path.
  • client_name: name of the client, which must be unique.
  • client: list of port forwarding configurations, mapping port 22 on the local machine to port 12222 on the server in this example.

Then start the client with:

nt_client -c config_c.json

3. SSH connection

ssh -oPort=12222 [email protected]

Open the management page

http://192.168.9.224:18888/websocketpath/admin

Full Configuration Description (please delete the comments when using)

  • Client config_c.json
{
  "server": {  // Server configuration to connect to
    "port": 18888,  // Port
    "host": "192.168.9.224",  // IP address
    "https": false,  // Whether the server is using HTTPS
    "password": "helloworld",  // Password
    "path": "/websocket_path"  // WebSocket path
  },
  "client": [  // List of forwarding configurations
    {
      "name": "ssh",
      "remote_port": 1222,
      "local_port": 22,
      "local_ip": "127.0.0.1"
    },
    {
      "name": "mongo",
      "remote_port": 1223,
      "local_port": 27017,
      "local_ip": "127.0.0.1"
    }
  ],
  "client_name": "ubuntu1",  // Client name, must be unique
  "log_file": "/var/log/nt/nt.log"  // Path to log file
}
  • Server config_c.json
{
    "port": 18888,  // Listening port
    "password": "helloworld",  // Password
    "path": "/websocket_path",  // WebSocket path
    "log_file": "/var/log/nt/nt.log",  // Path to log file
    "admin": {  
        "enable": true,  // Whether to enable admin page
        "admin_password": "new_password"  // Password for admin page
    }
}

Update history

  • 1.1.7: Fixed duplicate client_name
  • 1.1.6: Fixed client WebSocketException: socket is already opened.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

proxynt-1.1.7.tar.gz (340.4 kB view details)

Uploaded Source

Built Distribution

proxynt-1.1.7-py3-none-any.whl (366.3 kB view details)

Uploaded Python 3

File details

Details for the file proxynt-1.1.7.tar.gz.

File metadata

  • Download URL: proxynt-1.1.7.tar.gz
  • Upload date:
  • Size: 340.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.10

File hashes

Hashes for proxynt-1.1.7.tar.gz
Algorithm Hash digest
SHA256 2b7cd252b20ebe346c7b13f5483a7cc95e3e4827ed25b0233bfe7fe4a8b70b04
MD5 88c6d4aab35310c81ce4ccb34a556a89
BLAKE2b-256 9baeacf5a0dd082b398b47f126ac887f89b0d251ec2f62425a11b84b2ae3f2ae

See more details on using hashes here.

File details

Details for the file proxynt-1.1.7-py3-none-any.whl.

File metadata

  • Download URL: proxynt-1.1.7-py3-none-any.whl
  • Upload date:
  • Size: 366.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.10

File hashes

Hashes for proxynt-1.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 21bddf6c531bc381a039976350ead256cdcdc740ca687a0c2074ccea59f1ad5f
MD5 7408f3bc7d5680b742f42ae885f7ede3
BLAKE2b-256 9753cf5d14625c3f09e41fbdab7fe6b96a1e4cd73586dbd6bca56fab04878901

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page