portfwd
v0.0.7
一個低效能連接埠轉送實現
要求設定檔和程式放在一起,且名字必須是config.json , 設定檔格式為
interface Config {
proxy : {
[ localPort : string ] : string ;
}
APIPort : string ;
}其中APIPort為api 監聽的連接埠。
範例請參閱範例配置
提供了一個簡陋的web。
application/json GET /ping
request
無
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
無
response
interface Resp {
message : 'done'
} GET /proxy
request
無
response
type Resp = {
[ k in keyof ProxyPool ] : string
} GET /proxy/:localPort
request
無
response
interface Resp {
local : string
target : string
}