portfwd
v0.0.7
A low-performance port forwarding implementation
The configuration file is required to be placed together with the program, and the name must be config.json
. The configuration file format is
interface Config {
proxy : {
[ localPort : string ] : string ;
}
APIPort : string ;
}
APIPort
is the port that the api listens on.
See sample configuration for examples
Provides a simple web.
application/json
GET /ping
request
none
response
interface Resp {
message : 'pong'
}
POST /proxy
request
interface Req {
local : string // 比如 "10086"
targrt : string //比如 "127.0.0.1:10010"
}
response
interface Resp {
message : 'done'
}
PATCH /proxy/:localPort
request
interface Req {
targrt : string //比如 "127.0.0.1:10010"
}
response
interface Resp {
message : 'done'
}
DELETE /proxy/:localPort
request
none
response
interface Resp {
message : 'done'
}
GET /proxy
request
none
response
type Resp = {
[ k in keyof ProxyPool ] : string
}
GET /proxy/:localPort
request
none
response
interface Resp {
local : string
target : string
}