中文 | English
- Very easy to use
- Support TCP
- Support UDP
- Support IP whitelist
# Init config file
./go-public init server
# Save the generated token, will be used in the client side for authentication
cat go-public-server.yaml
# Start the server
./go-public
Or you can use docker to run the server:
docker run -d --restart always --name go-public -p 6871:6871 -p 8080:8080 -v /home/ubuntu/data/go-public:/app justsong/go-public
IP whitelist configuration example:
# go-public-server.yaml
whitelist:
- 123.213.241.5
- 123.213.242.9
- 125.216.243.1
### Client Side
```bash
# Initialize config file
./go-public init client
# Modify the config file with your saved token
vim go-public-client.yaml
# Start the client
# Please be aware that the remote port is not the port that the server listens on
# as specified in the configuration file, but rather the port on which you want
# to map the local port.
./go-public <local_port> <remote_port>
# For example:
./go-public 3000 8080 # Forward local port 3000 to remote port 8080
sequenceDiagram
participant Local Server
participant Go Public Client
participant Go Public Server
participant User
Go Public Client->>Go Public Server: Initialize connection
User->>Go Public Server: Request
Go Public Server->>Go Public Client: Assign connection uuid
Go Public Client->>Go Public Server: Make a new connection with uuid
Go Public Client->>Local Server: Make a new connection
Go Public Server->>Go Public Client: Forward request
Go Public Client->>Local Server: Forward request
Local Server->>Go Public Client: Response
Go Public Client->>Go Public Server: Forward response
Go Public Server->>User: Forward Response