• Stars
    star
    128
  • Rank 272,181 (Top 6 %)
  • Language
    Go
  • License
    MIT License
  • Created over 7 years ago
  • Updated about 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

简单的反向代理用于内网穿透,支持HTTP/HTTPS转发

rproxy

简单的反向代理用于内网穿透

特别注意,此工具只适合小文件类的访问测试,用来做做数据调试。当初也只是用于微信公众号开发,所以定位也是如此(注:目前代码中限制一个包最大为4M)

前言

最近周末闲来无事,想起了做下微信公共号的开发,但微信限制只能80端口的,自己用的城中村的那种宽带,共用一个公网,没办法自己用路由做端口映射。自己的服务器在腾讯云上,每次都要编译完后用ftp上传再进行调试,非常的浪费时间。 一时间又不知道上哪找一个符合我的这种要求的工具,就索性自己构思了下,整个工作流程大致为:

工作原理

外部请求自己服务器上的HTTP服务端 -> 将数据传递给Socket服务器 -> Socket服务器将数据发送至已连接的Socket客户端 -> Socket客户端收到数据 -> 使用http请求本地http服务端 -> 本地http服务端处理相关后返回 -> Socket客户端将返回的数据发送至Socket服务端 -> Socket服务端解析出数据后原路返回至外部请求的HTTP

使用方法

1、go get github.com/ying32/rproxy
2、使用构建命令
3、参照命令行用例使用,或者使用带GUI的客户端

命令行说明

  --tcpport      # Socket连接或者监听的端口。   
  --httpport     # 当mode为server时为服务端监听端口,当为mode为client时为转发至本地客户端的端口。  
  --mode         # 启动模式,可选为client、server,默认为client。  
  --svraddr      # 当mode为client时有效,为连接服务器的地址,不需要填写端口。    
  --vkey         # 客户端与服务端建立连接时校验的加密key,简单的。  
  ### 以下参数为v0.6版本及之后的
  --ishttps      # httpPort端口是否只用作HTTPS监听,默认为false。    
  --tlscafile    # 当ishttps为true时,所需的CA根证书文件。可为空,根据实际情况确定。  
  --tlscertfile  # 当ishttps为true时,所需求的TLS证书文件。  
  --tlskeyfile   # 当ishttps为true时,所需求的TLS密匙文件。  
  --iszip        # 是否开启zip压缩
  --cfgfile      # 使用指定的配置文件中的参数,此时只有mode参数有效   

用例

命令行用例

  • HTTP:
## ---- 从命令行加载主要参数 ----
# 服务端
rproxy --tcpport=8285 --httpport=8286 --mode="server" --vkey="DKibZF5TXvic1g3kY" 

# 客户端
rproxy --tcpport=8285 --httpport=8080 --svraddr="127.0.0.1" --vkey="DKibZF5TXvic1g3kY"

## ---- 从配置文件加载主要参数 ----
# 服务端
rproxy --mode="server" --cfgfile="./conf/config.cfg"

# 客户端
rproxy --cfgfile="./conf/config.cfg"
  • HTTPS
## ---- 从命令行加载主要参数 ----
# 服务端
rproxy --tcpport=8285 --httpport=8286 --mode="server" --ishttps=true --tlscafile="./cert/ca.pem" --tlscertfile="./cert/server.pem" --tlskeyfile="./cert/server.key" --vkey="DKibZF5TXvic1g3kY"

# 客户端 
rproxy --tcpport=8285 --httpport=8089 --svraddr="127.0.0.1" --ishttps=true --tlscafile="./cert/ca.pem" --tlscertfile="./cert/client.pem" --tlskeyfile="./cert/client.key" --vkey="DKibZF5TXvic1g3kY"

## ---- 从配置文件加载主要参数 ----
# 服务端
rproxy --mode="server" --cfgfile="./conf/confighttps.cfg"

# 客户端
rproxy --cfgfile="./conf/confighttps.cfg"

带GUI的客户端

查看截图

操作系统支持

支持Windows、Linux、MacOSX等,无第三方依赖库。

二进制下载

More Repositories

1

govcl

Cross-platform Go/Golang GUI library.
Go
2,098
star
2

duilib-for-Delphi

DDuilib是一个建立在C++开源项目duilib之上,且最大限度不去修改duilib源代码从而可以应用在Delphi或者FreePascal中构建Direcut UI的开源项目(作者已弃坑)。
Pascal
147
star
3

liblcl

A common cross-platform GUI library, the core uses Lazarus LCL.
Pascal
121
star
4

htmlparser

delphi html parser(代码是改自原wr960204的HtmlParser)
Pascal
69
star
5

dylib

Universal cross-platform dynamic link library call, support dll, so, dylib. Move from: github.com/ying32/govcl/vcl/dylib
Go
42
star
6

readability

readability for golang. 网页文章标题和正文抽取工具
Go
32
star
7

nim-vcl

cross-platform nim GUI
Nim
31
star
8

res2go-ide-plugin

res2go Lazarus IDE plug-in
Pascal
30
star
9

xldl

迅雷下载引擎SDK Go语言版
Go
27
star
10

JavaClassToDelphiUnit

解析JavaClass文件生成Delphi开发Android单元
Pascal
19
star
11

rust-vcl

cross-platform rust GUI
Rust
13
star
12

FMXWndProcHook

FMX下TForm的WndProc HOOK
Pascal
8
star
13

delphi-javascript

Automatically exported from code.google.com/p/delphi-javascript
Pascal
8
star
14

qqwry

纯真ip数据库查询
Go
7
star
15

alidayu

阿里大于最新sdk 2017-05-25
Go
7
star
16

ying32.github.io

Official website of GoVCL
Go
5
star
17

jxmarshal

json and xml Marshal/UnMarshal
Pascal
5
star
18

liblclbinres

此仓库只是用来存储golang的liblcl二进制包(This repository is only used to store golang liblcl binary package)
Go
5
star
19

xl7

xl7 sdk for Go, 迅雷7 Go语言SDK。这个版本的官方Demo都有问题,没具体研究过问题出在何处,推荐用老版本的SDK
Go
5
star
20

RTXCPluginForDelphiSDK

导入自:https://gitee.com/ying32/RTXCPluginForDelphiSDK
Pascal
4
star
21

IpoptPasHeader

Ipopt Pascal头文件
Pascal
3
star
22

babel

jsx编译和压缩
Go
3
star
23

YingBlog

自己的一个博客站点,学习golang的第二个作品
Go
2
star
24

sdnsserver

simple dns server
Go
2
star
25

dcef3

Automatically exported from code.google.com/p/dcef3
Pascal
2
star