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:

The management page URL is the WebSocket path + /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.8.tar.gz (340.3 kB view details)

Uploaded Source

Built Distribution

proxynt-1.1.8-py3-none-any.whl (366.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: proxynt-1.1.8.tar.gz
  • Upload date:
  • Size: 340.3 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.8.tar.gz
Algorithm Hash digest
SHA256 6cba323d3965a3876e9efb870d72d42420b874c955e456af21bfc135bf1664e1
MD5 c083a14aaf2ee237dc704dd540f85a7a
BLAKE2b-256 8587e21a408743bcd813362637731c7b1b6cd96619344176cf3d2c10d4912990

See more details on using hashes here.

File details

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

File metadata

  • Download URL: proxynt-1.1.8-py3-none-any.whl
  • Upload date:
  • Size: 366.2 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.8-py3-none-any.whl
Algorithm Hash digest
SHA256 aa0a292513f58fb8b15db03ea1d5703f3d37a6acd2bd7c0da964d14e817c39ed
MD5 2eb2c2342c8a42cdc254804b03a3c1a0
BLAKE2b-256 ac136439ada78f93de3ea49795a2f2f1fee2a860b83218c2edc147d21db0bd22

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