Skip to content

Commit

Permalink
Merge pull request #42 from zema1/release-aspx-webflux
Browse files Browse the repository at this point in the history
Feat: add aspx and webflux support
  • Loading branch information
zema1 authored Dec 18, 2023
2 parents 5f4aba8 + 02b5f83 commit 7e1d820
Show file tree
Hide file tree
Showing 17 changed files with 1,149 additions and 74 deletions.
2 changes: 1 addition & 1 deletion .github/actions/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ runs:
with:
docker_buildx: false
- if: inputs.jar == 'true'
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: '8'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ jobs:
name: golangci-lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-go@v4
with:
go-version: '1.20'
go-version: '1.21'
- run: go mod download
- uses: golangci/golangci-lint-action@v3
with:
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ jobs:
GOOS: ${{ matrix.os }}
GOARCH: ${{ matrix.arch }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-go@v4
with:
go-version: '1.20'
go-version: '1.21'
- run: go build -trimpath -ldflags "-w -s -extldflags '-static' -X main.Version=${{ github.ref_name }}" -o target/${{ matrix.output }}
- uses: actions/upload-artifact@v3
with:
Expand All @@ -69,13 +69,13 @@ jobs:
output: suo5-gui-linux
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup NodeJS
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: 16
node-version: 18
- name: Bump manifest version
if: startsWith(github.ref, 'refs/tags/')
working-directory: gui
Expand All @@ -87,7 +87,7 @@ jobs:
build-name: ${{ matrix.output }}
build-platform: ${{ matrix.platform }}
app-working-directory: gui
go-version: '1.20'
go-version: '1.21'
package: false
- if: runner.os == 'macOS'
shell: bash
Expand All @@ -109,7 +109,7 @@ jobs:
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
with:
name: target
Expand Down
62 changes: 50 additions & 12 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ jobs:
name: Go Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-go@v4
with:
go-version: '1.20'
go-version: '1.21'
- run: go mod download
- run: go test $(go list ./... | grep -v /gui/ | grep -v /tests/)

Expand All @@ -23,12 +23,12 @@ jobs:
env:
CGO_ENABLED: 0
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-go@v4
with:
go-version: '1.20'
go-version: '1.21'
- run: go build -trimpath -ldflags "-w -s -extldflags '-static'" -o suo5
- uses: actions/upload-artifact@v3
with:
Expand All @@ -49,7 +49,7 @@ jobs:
SUO5_JSP_URL: http://127.0.0.1:8080/assets/suo5.jsp
SUO5_JSPX_URL: http://127.0.0.1:8080/assets/suo5.jspx
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./.github/actions
- run: |
set -ex
Expand Down Expand Up @@ -92,7 +92,7 @@ jobs:
SUO5_JSP_URL: http://127.0.0.1:8080/assets/suo5.jsp
SUO5_JSPX_URL: http://127.0.0.1:8080/assets/suo5.jspx
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./.github/actions
- run: |
set -ex
Expand Down Expand Up @@ -123,7 +123,7 @@ jobs:
SUO5_JSP_URL: http://127.0.0.1:8080/assets/suo5.jsp
SUO5_JSPX_URL: http://127.0.0.1:8080/assets/suo5.jspx
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./.github/actions
- run: |
set -ex
Expand Down Expand Up @@ -156,7 +156,7 @@ jobs:
SUO5_JSP_URL: http://127.0.0.1:9080/assets/suo5.jsp
SUO5_JSPX_URL: http://127.0.0.1:9080/assets/suo5.jspx
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./.github/actions
with:
jar: true
Expand Down Expand Up @@ -191,7 +191,7 @@ jobs:
SUO5_JSP_URL: http://127.0.0.1:9060/console/assets/suo5.jsp
SUO5_JSPX_URL: http://127.0.0.1:9060/console/assets/suo5.jspx
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./.github/actions
with:
jar: true
Expand Down Expand Up @@ -236,7 +236,7 @@ jobs:
SUO5_JSP_URL: http://127.0.0.1:7001/assets/suo5.jsp
SUO5_JSPX_URL: http://127.0.0.1:7001/assets/suo5.jspx
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./.github/actions
with:
jar: true
Expand Down Expand Up @@ -324,7 +324,7 @@ jobs:
SUO5_JSP_URL: http://127.0.0.1:8080/assets/suo5.jsp
SUO5_JSPX_URL: http://127.0.0.1:8080/assets/suo5.jspx
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./.github/actions
- run: |
set -ex
Expand All @@ -339,4 +339,42 @@ jobs:
./suo5 -debug -t ${{ env.SUO5_JSPX_URL }} -T https://www.bing.com
./suo5 -debug -t ${{ env.SUO5_JSPX_URL }} -T https://www.bing.com -mode full
./suo5 -debug -t ${{ env.SUO5_JSPX_URL }} -T https://www.bing.com -mode half
fi
fi
donet-test:
name: DoNet
needs: build-binary
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- image: junalmeida/mono-web:latest
mount: /var/www/sample-app
env:
SUO5_ASPX_URL: http://127.0.0.1:8080/suo5.aspx
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions
- run: |
set -ex
mkdir -p config
cat << EOF > ./config/sample.webapp
<?xml version="1.0" encoding="UTF-8"?>
<apps>
<web-application>
<name>root</name>
<vhost>*</vhost>
<vport>-1</vport>
<vpath>/</vpath>
<path>/var/www/sample-app/</path>
</web-application>
</apps>
EOF
cat config/sample.webapp
docker run -it --rm -d -p8080:80 -v ${{ github.workspace }}/config:/etc/mono/pools -v ${{ github.workspace }}/assets:${{ matrix.mount }} ${{ matrix.image }}
bash ./.github/workflows/ready.sh ${{ env.SUO5_ASPX_URL }} 30
curl -v ${{ env.SUO5_ASPX_URL }}
chmod +x ./suo5
./suo5 -debug -t ${{ env.SUO5_ASPX_URL }} -T https://www.bing.com
./suo5 -debug -t ${{ env.SUO5_ASPX_URL }} -T https://www.bing.com -mode half
28 changes: 25 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,37 @@
# 更新记录

## [1.0.0] 2023.12.18

## 新增

- 增加 `aspx` 脚本支持,最低支持 .Net Framework 2.0
- 增加 `WebFlex` 响应式支持,并贴心的提供一键注入 SpringCloudGateway 的代码
- 增加 `cookiejar` 支持,默认不启用
- 增加 `JDK21` 兼容性测试, 完美支持 `JDK21`
- 增加本地写超时的限制,解决某些情况连接数膨胀的问题
- 使用随机 `TLS` 指纹,去除 Go 语言本身的 `TLS` 握手特征
- 使用随机异或密钥,去除连接阶段响应包完全一致的流量特征

## 修复

- 修复界面版日志太多时 OOM 的问题
- 修复上游代理用户名密码大写不生效的问题
- 修复连接测试阶段未使用上游代理的问题

## [0.9.0] 2023.06-29

- 增加脏数据跳过逻辑, 自动计算偏移 #11
- 增加 `jspx` 形式的服务端, 通过全部中间件的测试 #31
- 允许连接测试时的 `EOF` 的情况,解决部分 Listener 内存马连不上的问题

### 修复

- 修复上游代理对连接测试的这个请求不生效的问题

## [0.8.0] 2023.05-23

### 修复

- 上一个版本因上游库忘记更新导致的连接超时问题 #28 #29

## [0.7.0] 2023-05-17
Expand All @@ -21,19 +41,21 @@
- 增加 WebSphere 全版本支持
- 增加东方通(TongWeb)支持, 部分旧版需要禁用 gzip 才行
- 增加 `-no-gzip` 选项用于禁用响应中的 gzip 压缩
- 上游代理 `-proxy` 增加 http(s) 的支持,不再仅限于 socks5 [#23](https://github.com/zema1/suo5/issues/23) [#25](https://github.com/zema1/suo5/issues/25)
- 去除 Session 相关依赖,优化 stream 读写相关的代码, 有效解决部分能连上没数据的问题 [#22](https://github.com/zema1/suo5/issues/22)
- 上游代理 `-proxy` 增加 http(s) 的支持,不再仅限于
socks5 [#23](https://github.com/zema1/suo5/issues/23) [#25](https://github.com/zema1/suo5/issues/25)
- 去除 Session 相关依赖,优化 stream 读写相关的代码,
有效解决部分能连上没数据的问题 [#22](https://github.com/zema1/suo5/issues/22)
- 增加代理自测试逻辑,如果没有报错那么代理一定可用
- 重写心跳包逻辑,如果 5s 内有数据读写,就不必发送心跳了
- 基础连接测试的逻辑融合到全双工的判断中,减少一个测试请求

### 修复

- 修复 GUI 版界面版本号错误的问题
- 暂时禁用 darwin 的内存占用显示

## [0.6.0] - 2023-04-10


### 新增

- 降低 JDK 依赖到 Java 4, 目前兼容 Java 4 ~ Java 19 全版本
Expand Down
7 changes: 7 additions & 0 deletions DONATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## 捐赠

感谢您的支持,这将使我更有动力维护开源项目!

您也可以从首页加我微信,有问题方便讨论, 添加好友记得备注 `问题反馈与讨论` ~

<img src="https://github.com/zema1/suo5/assets/20637881/3729751a-bad9-47bf-bb02-efb0b6b66c43" width="500px"/>
32 changes: 14 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@

----

`suo5` 是一个全新的 HTTP 代理隧道,基于 `HTTP/1.1` `Chunked-Encoding`
构建相比 [Neo-reGeorg](https://github.com/L-codes/Neo-reGeorg) 等传统隧道工具, `suo5`
`suo5` 是一个高性能 HTTP 隧道代理工具,它基于双向的 `Chunked-Encoding`
构建, 相比 [Neo-reGeorg](https://github.com/L-codes/Neo-reGeorg) 等传统隧道工具, `suo5`
的性能可以达到其数十倍。查看 [性能测试](./tests)

其主要特性如下:

- 同时支持全双工与半双工模式,传输性能接近 FRP
- 支持在 Nginx 反向代理和负载均衡场景使用
- 支持 Java4 ~ Java 21 全版本和各大主流中间件服务
- 支持 IIS .Net Framework >= 2.0 的所有版本
- 完善的连接控制和并发管理,使用流畅丝滑
- 支持 Tomcat Jetty Weblogic WebSphere Resin 等主流中间件
- 支持 Java4 ~ Java 19 全版本, 兼容性拉满
- 同时提供提供命令行和图形化界面

原理介绍 [https://koalr.me/posts/suo5-a-hign-performace-http-socks/](https://koalr.me/posts/suo5-a-hign-performace-http-socks/)
Expand All @@ -39,7 +39,7 @@
前往 [Releases](https://github.com/zema1/suo5/releases) 下载编译好的二进制,其中带 `gui` 的版本是界面版,不带 `gui`
的为命令行版。所有编译由 Github Action 自动构建,请放心使用。

使用时需上传 [suo5.jsp](./assets/) 到目标环境中并确保可以执行
使用时需上传 [服务端](./assets/) 到目标环境中并确保正常执行

### 界面版

Expand All @@ -54,28 +54,23 @@
USAGE:
suo5 [global options] command [command options] [arguments...]
VERSION:
v0.9.0
COMMANDS:
help, h Shows a list of commands or help for one command
GLOBAL OPTIONS:
--target value, -t value set the remote server url, ex: http://localhost:8080/tomcat_debug_war_exploded/
--listen value, -l value set the listen address of socks5 server (default: "127.0.0.1:1111")
--target value, -t value the remote server url, ex: http://localhost:8080/suo5.jsp
--listen value, -l value listen address of socks5 server (default: "127.0.0.1:1111")
--method value, -m value http request method (default: "POST")
--redirect value, -r value redirect to the url if host not matched, used to bypass load balance
--no-auth disable socks5 authentication (default: true)
--auth value socks5 creds, username:password, leave empty to auto generate
--mode value connection mode, choices are auto, full, half (default: "auto")
--ua value the user-agent used to send request (default: "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.1.2.3")
--ua value set the request User-Agent (default: "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.1.2.3")
--header value, -H value [ --header value, -H value ] use extra header, ex -H 'Cookie: abc'
--timeout value http request timeout in seconds (default: 10)
--buf-size value set the request max body size (default: 327680)
--proxy value use upstream proxy, support both socks5 and http(s), eg: socks5://127.0.0.1:7890
--timeout value request timeout in seconds (default: 10)
--buf-size value request max body size (default: 327680)
--proxy value set upstream proxy, support socks5/http(s), eg: socks5://127.0.0.1:7890
--debug, -d debug the traffic, print more details (default: false)
--no-heartbeat, --nh disable heartbeat to the remote server which will send data every 5s (default: false)
--no-gzip, --ng disable gzip compression, which will improve compatibility with some old servers (default: false)
--jar, -j enable cookiejar (default: false)
--help, -h show help
--version, -v print the version
```
Expand Down Expand Up @@ -126,7 +121,8 @@ $ ./suo5 -t https://example.com/proxy.jsp -r http://172.0.3.2/code/proxy.jsp

- [x] 支持配置上游 socks 代理
- [x] 支持负载均衡的场景
- [ ] 支持 .Net 的类型
- [x] 支持 .Net 的类型
- [ ] 流量特征去除

## 参考

Expand Down
Loading

0 comments on commit 7e1d820

Please sign in to comment.