GithubHelp home page GithubHelp logo

j0hnnie / portfwd Goto Github PK

View Code? Open in Web Editor NEW

This project forked from muzea/portfwd

0.0 1.0 0.0 15 KB

A low performance port forwarding implementation

Home Page: https://muzea.github.io/portfwd

Shell 14.59% Go 45.00% HTML 22.07% JavaScript 18.34%

portfwd's Introduction

一个低性能端口转发实现

使用

要求配置文件和程序放在一起,且名字必须是 config.json, 配置文件格式为

interface Config {
  proxy: {
    [localPort: string]: string;
  }
  APIPort: string;
}

其中 APIPort 为 api 监听的端口。

示例参见 示例配置

web 控制台

提供了一个简陋的web

api

  • 均要求数据为 application/json
  • 类型描述为typescript

ping

GET /ping

request

response

interface Resp {
  message: 'pong'
}

add

POST /proxy

request

interface Req {
  local: string // 比如 "10086"
  targrt: string //比如 "127.0.0.1:10010"
}

response

interface Resp {
  message: 'done'
}

update

PATCH /proxy/:localPort

request

interface Req {
  targrt: string //比如 "127.0.0.1:10010"
}

response

interface Resp {
  message: 'done'
}

delete

DELETE /proxy/:localPort

request

response

interface Resp {
  message: 'done'
}

proxy config

GET /proxy

request

response

type Resp = {
    [k in keyof ProxyPool]: string
}

proxy item

GET /proxy/:localPort

request

response

interface Resp {
  local: string
  target: string
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.