Giter Club home page Giter Club logo

portproxy's Introduction

PortProxy

不能多言,言多必死,死后鞭尸。

一个简单的端口转发工具,只不过中间允许你加入自己的流验证和流变换算法。

运行平台

基于 .NET CORE 2.0 编写,支持Windows/Linux/Mac等平台。
分为本地端和远程端,将远程端上指定地址的端口(如远程端上的Socks5服务器端口)映射到本地。
所以请发挥自己的想象去创造用途,不能多言,言多必死,死后鞭尸。

开发配置

注意

这个代码是不完整的!StreamValidatorStreamTransformer 没有给出任何默认实现,请依据文档发挥自己的创意写出相关的代码。

本地生成验证数据、服务端校验认证数据、流变换双向都是要进行的操作。

附言

似乎用在Linux上(比如CentOS7)要比Windows上更简单诶。

比如服务端配置在远程CentOS7上:

  1. 安装.net core(假定安装在/usr/bin/dotnet)
  2. 编译后的程序发布到 /data/server/portproxy/
  3. 将仓库中的 portproxy.service 文件复制到/lib/systemd/system/,如果路径和上述的不一致记得先改下
  4. 执行 systemctl start portproxysystemctl enable portproxy 启用

默认本地端口和远程端口都是10240,支持参数为:

  • --local 指定工作模式为本地模式,否则为远程模式
  • --port=<int> 当前监听端口,默认本地模式为1080,远程模式为10240
  • --buffer=<int> 用于流操作的缓冲区大小,单位为KB,默认为128KB
  • --server=<ADDRESS> 指定上游服务器地址,对于本地模式是指远程对应的服务器,对于远程模式则指的是转发的目标服务器
  • --serverport=<int> 指定上游服务器端口,对于本地模式默认为10240,对于远程模式默认为1080

如果需要修改默认参数,记得修改上述的service文件。

对于Windows机器,貌似可以直接用 dotnet PortProxy.dll <参数>直接运行,至于服务化嘛……懒得搞……完全可以搞成一个Windows Service,有兴趣的自己搞了。

授权

GPLv3

portproxy's People

Contributors

iccfish avatar

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.