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
}