portfwd
v0.0.7
低パフォーマンスのポート転送の実装
構成ファイルはプログラムと一緒に配置する必要があり、その名前はconfig.jsonである必要があります。
interface Config {
proxy : {
[ localPort : string ] : string ;
}
APIPort : string ;
} APIPort API がリッスンするポートです。
例については、サンプル構成を参照してください
シンプルなウェブを提供します。
application/jsonである必要がありますGET /ping
リクエスト
なし
応答
interface Resp {
message : 'pong'
}POST /proxy
リクエスト
interface Req {
local : string // 比如 "10086"
targrt : string //比如 "127.0.0.1:10010"
}応答
interface Resp {
message : 'done'
}PATCH /proxy/:localPort
リクエスト
interface Req {
targrt : string //比如 "127.0.0.1:10010"
}応答
interface Resp {
message : 'done'
}DELETE /proxy/:localPort
リクエスト
なし
応答
interface Resp {
message : 'done'
}GET /proxy
リクエスト
なし
応答
type Resp = {
[ k in keyof ProxyPool ] : string
}GET /proxy/:localPort
リクエスト
なし
応答
interface Resp {
local : string
target : string
}