Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6389c8bf43 | ||
|
|
c478d8ba80 | ||
|
|
a93646619e | ||
|
|
f83f9e45a4 | ||
|
|
2104f829ef | ||
|
|
456ac900e9 | ||
|
|
72d79b5ccf | ||
|
|
2ae5259670 | ||
|
|
0c5c7908ae | ||
|
|
7282e32ac5 | ||
|
|
810661d5f4 | ||
|
|
7dc605ab7c | ||
|
|
150c69d37c | ||
|
|
9cbcf4de2e | ||
|
|
f124557686 | ||
|
|
4a7df310f1 | ||
|
|
e0aaccc949 | ||
|
|
da4b030234 | ||
|
|
7e7a1546b3 | ||
|
|
b001247088 | ||
|
|
b83e40051e | ||
|
|
a58902f984 | ||
|
|
9188a41ad6 | ||
|
|
e88671c880 | ||
|
|
82773034c6 | ||
|
|
2e33f9ff1a | ||
|
|
23f3ec1ba2 | ||
|
|
666f071e37 | ||
|
|
bd56ce094a | ||
|
|
a7ee52dbf1 | ||
|
|
95764cdfb0 | ||
|
|
22ff47dbe6 | ||
|
|
391d664710 | ||
|
|
f26ed2d12e | ||
|
|
aa02b7b3c2 | ||
|
|
344bf11b88 | ||
|
|
f9ab82cd80 | ||
|
|
e97aacee8f | ||
|
|
59acada928 | ||
|
|
498ffeed46 | ||
|
|
0164e71f37 | ||
|
|
65abda93fb | ||
|
|
9c818e5fcf | ||
|
|
a8c05a9e5e | ||
|
|
01ac42f269 | ||
|
|
d4f77524cf | ||
|
|
d22b8df0ac | ||
|
|
c96d91c17c | ||
|
|
af9cf5d260 | ||
|
|
6eb31879ab | ||
|
|
8cf89e86d5 | ||
|
|
43aec0d8de | ||
|
|
d343231351 | ||
|
|
83519299f8 | ||
|
|
87c2ff846a | ||
|
|
02af8df384 | ||
|
|
81d8a41842 | ||
|
|
f2999fa384 | ||
|
|
37ff5abb28 | ||
|
|
4b4bcd2829 | ||
|
|
adc8cb3f66 | ||
|
|
81c3e3f219 | ||
|
|
587359d40e | ||
|
|
cedef6589f | ||
|
|
9a1f0c65ce | ||
|
|
031eeae706 | ||
|
|
32366a06f5 | ||
|
|
4873fc5084 | ||
|
|
fda50fb383 | ||
|
|
65da4cdc53 | ||
|
|
7b8e92b402 | ||
|
|
c5d736eafd | ||
|
|
85e5e72363 | ||
|
|
216bbb449f | ||
|
|
1378e808f8 | ||
|
|
8a23c83c83 | ||
|
|
2936a934d2 | ||
|
|
98e9a9c663 | ||
|
|
a8fec7caef | ||
|
|
64c155ad68 | ||
|
|
b260602810 | ||
|
|
ca2e7e5254 | ||
|
|
00eb14c3be | ||
|
|
df7aec109d | ||
|
|
59ce5cfe85 | ||
|
|
d6ff43c7a6 | ||
|
|
9d226ab23b | ||
|
|
50afac643e | ||
|
|
249dd5ec12 | ||
|
|
7c82dce6a6 | ||
|
|
55c62c9281 | ||
|
|
b01226b5c5 | ||
|
|
e2f64ce407 | ||
|
|
c2cf34e6c8 | ||
|
|
1a326397f6 | ||
|
|
e6e0639a92 | ||
|
|
8e26e5b36c | ||
|
|
0006a33a5d | ||
|
|
98ab8fd3d0 | ||
|
|
131a8120ca | ||
|
|
14b03c5d51 | ||
|
|
e207b81d3b | ||
|
|
ac901a551b | ||
|
|
4db6a15113 |
@@ -13,7 +13,7 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
# see: https://docs.github.com/zh/actions/using-jobs/choosing-the-runner-for-a-job
|
# see: https://docs.github.com/zh/actions/using-jobs/choosing-the-runner-for-a-job
|
||||||
# os: ['ubuntu-20.04', 'macos-12']
|
# os: ['ubuntu-20.04', 'macos-12']
|
||||||
os: ['ubuntu-20.04']
|
os: ['ubuntu-latest']
|
||||||
name: build - ${{ matrix.os }}
|
name: build - ${{ matrix.os }}
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
# https://github.com/softprops/action-gh-release/issues/236#issuecomment-1150530128
|
# https://github.com/softprops/action-gh-release/issues/236#issuecomment-1150530128
|
||||||
@@ -39,7 +39,7 @@ jobs:
|
|||||||
distribution: 'graalvm' # New 'distribution' option
|
distribution: 'graalvm' # New 'distribution' option
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Cache local Maven repository
|
- name: Cache local Maven repository
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: ~/.m2/repository
|
path: ~/.m2/repository
|
||||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||||
@@ -84,7 +84,7 @@ jobs:
|
|||||||
filename: neutrino-proxy-client-${{ env.OS }}-${{ env.VERSION }}-native.zip
|
filename: neutrino-proxy-client-${{ env.OS }}-${{ env.VERSION }}-native.zip
|
||||||
# 上传构建产物
|
# 上传构建产物
|
||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
uses: actions/upload-artifact@v3.0.0
|
uses: actions/upload-artifact@v4.3.1
|
||||||
with:
|
with:
|
||||||
name: neutrino-proxy-server-client-${{ env.OS }}-${{ env.VERSION }}
|
name: neutrino-proxy-server-client-${{ env.OS }}-${{ env.VERSION }}
|
||||||
path: |
|
path: |
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ jobs:
|
|||||||
distribution: 'graalvm' # New 'distribution' option
|
distribution: 'graalvm' # New 'distribution' option
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Cache local Maven repository
|
- name: Cache local Maven repository
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: ~/.m2/repository
|
path: ~/.m2/repository
|
||||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||||
@@ -83,7 +83,7 @@ jobs:
|
|||||||
filename: neutrino-proxy-client-${{ env.OS }}-${{ env.VERSION }}-native.zip
|
filename: neutrino-proxy-client-${{ env.OS }}-${{ env.VERSION }}-native.zip
|
||||||
# 上传构建产物
|
# 上传构建产物
|
||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
uses: actions/upload-artifact@v3.0.0
|
uses: actions/upload-artifact@v4.3.1
|
||||||
with:
|
with:
|
||||||
name: neutrino-proxy-server-client-${{ env.OS }}-${{ env.VERSION }}
|
name: neutrino-proxy-server-client-${{ env.OS }}-${{ env.VERSION }}
|
||||||
path: |
|
path: |
|
||||||
|
|||||||
@@ -0,0 +1,74 @@
|
|||||||
|
version: '1.0'
|
||||||
|
name: pipeline-docs-build
|
||||||
|
displayName: 官网静态资源构建
|
||||||
|
triggers:
|
||||||
|
trigger: auto
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
precise:
|
||||||
|
- master
|
||||||
|
paths:
|
||||||
|
include:
|
||||||
|
- neutrino-proxy-vuepress.*
|
||||||
|
variables:
|
||||||
|
global:
|
||||||
|
- git_token
|
||||||
|
- username
|
||||||
|
commit_name: aoshiguchen
|
||||||
|
commit_email: [email protected]
|
||||||
|
repo_url: https://gitee.com/dromara/neutrino-proxy.git
|
||||||
|
target_branch: site
|
||||||
|
stages:
|
||||||
|
- name: stage-build
|
||||||
|
displayName: 构建
|
||||||
|
strategy: naturally
|
||||||
|
trigger: auto
|
||||||
|
executor:
|
||||||
|
- asgc
|
||||||
|
steps:
|
||||||
|
- step: build@nodejs
|
||||||
|
name: build_nodejs
|
||||||
|
displayName: Nodejs 构建
|
||||||
|
nodeVersion: 14.16.0
|
||||||
|
commands:
|
||||||
|
- '# 切换到工作目录'
|
||||||
|
- ''
|
||||||
|
- cd ./neutrino-proxy-vuepress
|
||||||
|
- '# 设置NPM源,提升安装速度'
|
||||||
|
- npm config set registry https://registry.npmmirror.com
|
||||||
|
- ''
|
||||||
|
- '# 执行编译命令'
|
||||||
|
- npm install && npm run build
|
||||||
|
- ''
|
||||||
|
- '# 初始化git仓库'
|
||||||
|
- cd docs/.vuepress/dist
|
||||||
|
- git init
|
||||||
|
- ''
|
||||||
|
- '# 设置Git信息'
|
||||||
|
- GIT_REPO_URL=$repo_url
|
||||||
|
- GIT_USERNAME=$username
|
||||||
|
- GIT_NAME=$commit_name
|
||||||
|
- GIT_EMAIL=$commit_email
|
||||||
|
- GIT_TOKEN=$git_token
|
||||||
|
- echo "https://${GIT_USERNAME}:${GIT_TOKEN}@${GIT_REPO_URL#https://}" > ~/.git-credentials
|
||||||
|
- git config --global credential.helper store
|
||||||
|
- git remote add origin ${GIT_REPO_URL}
|
||||||
|
- git config user.name ${GIT_NAME}
|
||||||
|
- git config user.email ${GIT_EMAIL}
|
||||||
|
- ''
|
||||||
|
- '# 将构建产物推送到目标分支'
|
||||||
|
- git add -A
|
||||||
|
- '# git commit -m $GITEE_COMMIT_MESSAGE'
|
||||||
|
- git commit -m "update"
|
||||||
|
- git checkout -b $target_branch
|
||||||
|
- git push -f origin $target_branch
|
||||||
|
artifacts:
|
||||||
|
- name: BUILD_ARTIFACT
|
||||||
|
path:
|
||||||
|
- ./neutrino-proxy-vuepress/docs/.vuepress/dist
|
||||||
|
caches:
|
||||||
|
- ~/.npm
|
||||||
|
- ~/.yarn
|
||||||
|
notify: []
|
||||||
|
strategy:
|
||||||
|
retry: '0'
|
||||||
@@ -16,10 +16,8 @@
|
|||||||
- 中微子代理(neutrino-proxy)是一个基于netty的、开源的java内网穿透项目。
|
- 中微子代理(neutrino-proxy)是一个基于netty的、开源的java内网穿透项目。
|
||||||
- 技术栈:Solon、MybatisPlus、Netty
|
- 技术栈:Solon、MybatisPlus、Netty
|
||||||
- 遵循MIT许可,因此您可以对它进行复制、修改、传播并用于任何个人或商业行为。
|
- 遵循MIT许可,因此您可以对它进行复制、修改、传播并用于任何个人或商业行为。
|
||||||
- 官网地址1:https://neutrino-proxy.dromara.org
|
- 官网地址:https://neutrino-proxy-docs.asgc.fun
|
||||||
- 官网地址2:https://dromara.gitee.io/neutrino-proxy
|
- 快速上手请[点击这里](https://neutrino-proxy.dromara.org/neutrino-proxy/pages/793dcb/)
|
||||||
- 官网地址3:https://neutrino-proxy-docs.asgc.fun
|
|
||||||
- 快速上手请[点击这里](https://dromara.gitee.io/neutrino-proxy/pages/793dcb)
|
|
||||||
|
|
||||||
# 2、名称由来
|
# 2、名称由来
|
||||||
中微子,是轻子的一种,是组成自然界的最基本的粒子之一。它十分微小、不带电,可自由穿过地球,以接近光速运动,与其他物质的相互作用十分微弱,号称宇宙间的“隐身人”。
|
中微子,是轻子的一种,是组成自然界的最基本的粒子之一。它十分微小、不带电,可自由穿过地球,以接近光速运动,与其他物质的相互作用十分微弱,号称宇宙间的“隐身人”。
|
||||||
@@ -28,21 +26,30 @@
|
|||||||
|
|
||||||
因此以中微子命名,寓意着中微子代理拥有中微子"安全"、"快速"、"穿透力强"的特点。
|
因此以中微子命名,寓意着中微子代理拥有中微子"安全"、"快速"、"穿透力强"的特点。
|
||||||
|
|
||||||
# 3、运行示例
|
# 3、部署方式
|
||||||
|
- 1、[使用宝塔面板](https://neutrino-proxy.dromara.org/pages/9e0fde/)
|
||||||
|
- 2、[使用jar文件](https://neutrino-proxy.dromara.org/pages/eebea1/)
|
||||||
|
- 3、[使用Docker](https://neutrino-proxy.dromara.org/pages/5b9bef/)
|
||||||
|
- 4、[原生部署](https://neutrino-proxy.dromara.org/pages/69699a/)
|
||||||
|
- 5、[使用Docker-Compose](https://neutrino-proxy.dromara.org/pages/2d4123/)
|
||||||
|
|
||||||
|
# 4、运行示例
|
||||||

|

|
||||||

|

|
||||||

|

|
||||||

|

|
||||||

|

|
||||||
|
|
||||||
# 4、代理示意图
|
# 5、代理示意图
|
||||||

|

|
||||||
|
|
||||||
# 5、联系我们
|
# 6、联系我们
|
||||||
- 微信: yuyunshize
|
- 微信: yuyunshize
|
||||||
|
- GitCode:https://gitcode.com/dromara/neutrino-proxy
|
||||||
- Gitee: https://gitee.com/asgc/neutrino-proxy
|
- Gitee: https://gitee.com/asgc/neutrino-proxy
|
||||||
|
- Github仓库:https://github.com/dromara/neutrino-proxy
|
||||||
|
|
||||||
# 6、贡献者列表
|
# 7、贡献者列表
|
||||||
<p>
|
<p>
|
||||||
<a href="https://gitee.com/zcans" target="_blank">
|
<a href="https://gitee.com/zcans" target="_blank">
|
||||||
<img src="assets/developer/zcans.png" width="11%">
|
<img src="assets/developer/zcans.png" width="11%">
|
||||||
@@ -92,6 +99,9 @@
|
|||||||
<a href="https://gitee.com/nichenxyx" target="_blank">
|
<a href="https://gitee.com/nichenxyx" target="_blank">
|
||||||
<img src="assets/developer/NichenFly.jpg" width="11%">
|
<img src="assets/developer/NichenFly.jpg" width="11%">
|
||||||
</a>
|
</a>
|
||||||
|
<a href="https://gitee.com/miracrl" target="_blank">
|
||||||
|
<img src="assets/developer/miracrl.png" width="11%">
|
||||||
|
</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
# ❤️ 感谢
|
# ❤️ 感谢
|
||||||
|
|||||||
@@ -79,3 +79,18 @@
|
|||||||
- 支持对用户、license限速
|
- 支持对用户、license限速
|
||||||
- 修复HTTP(S)映射时使用tcp端口访问正常,使用域名访问偶现一直loading的问题
|
- 修复HTTP(S)映射时使用tcp端口访问正常,使用域名访问偶现一直loading的问题
|
||||||
- 修复HTTP(S)映射时使用映射的域名上传文件时,连接中断的问题
|
- 修复HTTP(S)映射时使用映射的域名上传文件时,连接中断的问题
|
||||||
|
|
||||||
|
## 2.0.2
|
||||||
|
- 部分细节优化
|
||||||
|
- 解决客户端docker方式部署环境变量指定参数不生效的问题
|
||||||
|
- 服务端解决服务端native下,清理日志定时任务报错的问题
|
||||||
|
- 解决后台分页查询的已知问题
|
||||||
|
- 端口映射中的客户端ip字段加长,解决配置阿里云数据库域名字段不够的问题
|
||||||
|
- 管理后台新增域名管理
|
||||||
|
- [x] 支持设置一个默认域名
|
||||||
|
- [x] 删除、修改、禁用实时生效
|
||||||
|
- [x] 支持维护https证书
|
||||||
|
- 端口映射支持支持绑定多个子域名
|
||||||
|
- 选择择不同的主域名、子域名变更实时生效
|
||||||
|
## 2.0.3
|
||||||
|
- 解决http请求拆包情况下域名映射失效的问题
|
||||||
|
|||||||
|
After Width: | Height: | Size: 44 KiB |
|
After Width: | Height: | Size: 164 KiB |
|
After Width: | Height: | Size: 123 KiB |
@@ -0,0 +1,81 @@
|
|||||||
|
# NeutrinoProxy2.0.2发布,端口映射支持绑定多个域名
|
||||||
|
|
||||||
|
## 项目简介
|
||||||
|
- [中微子代理(neutrino-proxy)](https://gitee.com/dromara/neutrino-proxy) 是一款基于Solon、Netty的内网穿透神器。该项目采用最为宽松的MIT协议,因此您可以对它进行复制、修改、传播并用于任何个人或商业行为。
|
||||||
|
- 市面上基于内网穿透的常见产品有:花生壳、TeamView、cpolar等。
|
||||||
|
- 常见的使用场景:
|
||||||
|
- 本地开发调试第三方回调
|
||||||
|
- 本地开发异地接口连调
|
||||||
|
- 远程登录内网windows机器
|
||||||
|
- 将本地服务映射到外网,用于演示
|
||||||
|
- GitCode:https://gitcode.com/dromara/neutrino-proxy
|
||||||
|
- Gitee仓库:https://gitee.com/dromara/neutrino-proxy
|
||||||
|
- Github仓库:https://github.com/dromara/neutrino-proxy
|
||||||
|
- 官网地址: https://neutrino-proxy.dromara.org
|
||||||
|
|
||||||
|
## 主要特点:
|
||||||
|
- 1、流量监控:首页图表、报表管理多维度流量监控。全方位掌握实时、历史代理数据。
|
||||||
|
- 2、用户/License:支持多用户、多客户端使用。后台禁用实时生效。
|
||||||
|
- 3、端口池:对外端口统一管理,支持用户、License独占端口。
|
||||||
|
- 4、端口映射:新增、编辑、删除、禁用实时生效。
|
||||||
|
- 5、Docker:服务端/客户端支持Docker一键部署。
|
||||||
|
- 6、SSL证书:隧道通信支持SSL加密,保护您的数据安全。
|
||||||
|
- 7、域名映射:支持绑定多个子域名,方便本地调试三方回调
|
||||||
|
- 8、多种协议:支持代理TCP、HTTP、HTTPS、UDP协议
|
||||||
|
- 9、原生部署:支持编译为原生可执行文件,更低部署门槛、更少内存占用
|
||||||
|
- 10、安全组:支持黑/白名单IP访问限制
|
||||||
|
- 11、限速:支持对License、端口映射限制上传/下载速度
|
||||||
|
- 12、采用最为宽松的MIT协议,免去你的后顾之忧
|
||||||
|
|
||||||
|
## 本次更新内容
|
||||||
|
- bug修复
|
||||||
|
- 解决安全组在ipv6场景下误拦截导致域名映射访问不通的问题
|
||||||
|
- 解决native编译后,端口池批量删除报错的问题
|
||||||
|
- 解决客户端docker方式部署环境变量指定参数不生效的问题
|
||||||
|
- 服务端解决native下清理日志定时任务报错的问题
|
||||||
|
- 解决后台分页查询的已知问题
|
||||||
|
- 端口映射中的客户端ip字段加长一点,解决配置阿里云数据库域名字段不够的问题
|
||||||
|
- 解决服务端native部署时,访问后台用户列表,日志警告“you should use: nativeMetadata.registerField(field) at aot runtime”的问题
|
||||||
|
- 新增功能
|
||||||
|
- 新增后台域名管理,⽀持新增、修改、删除、禁⽤主域名,支持添加多级域名。
|
||||||
|
- 域名管理支持上传域名对应的SSL证书、⽀持设置强制HTTPS、⽀持域名映射⾃动加载对应的服务器证书。
|
||||||
|
- 端口映射支持选择切换不同的主域名,⽀持绑定多个⼦域名,单个端⼝⽀持绑定多个不同的主域名。
|
||||||
|
|
||||||
|
## 安装使用说明
|
||||||
|
- 快速上手:https://neutrino-proxy.dromara.org/neutrino-proxy/pages/793dcb/
|
||||||
|
- 支持的部署方式
|
||||||
|
- 1、jar
|
||||||
|
- 2、docker
|
||||||
|
- 3、native
|
||||||
|
- windows
|
||||||
|
- linux
|
||||||
|
- mac
|
||||||
|
- 4、docker-compose
|
||||||
|
- 升级须知:
|
||||||
|
- **域名和SSL证书的配置由配置文件配置改为后台域名管理页面配置。**
|
||||||
|
- 去掉了配置文件声明服务器端域名和证书的方式,改为通过页面进行管理,请注意自行进行数据迁移。
|
||||||
|
- 数据库新增`域名表`和`域名映射中间表`,修改了`端口映射表`,涉及到表结构变更,执行[增量SQL](https://gitee.com/dromara/neutrino-proxy/blob/master/neutrino-proxy-server/src/main/resources/sql/mysql/update/UPDATE-20240808.SQL)
|
||||||
|
|
||||||
|
## 运行示例
|
||||||
|
#### License限速
|
||||||
|
<img src="./license2.png" width="100%"/>
|
||||||
|
|
||||||
|
#### 端口映射限速
|
||||||
|
<img src="./port-mapping2.png" width="100%"/>
|
||||||
|
|
||||||
|
#### 端口映射绑定多个域名
|
||||||
|
<img src="./port-mapping3.png" width="100%"/>
|
||||||
|
|
||||||
|
#### 安全组
|
||||||
|
<img src="./security-group1.png" width="100%"/>
|
||||||
|
<img src="./security-rule1.png" width="100%"/>
|
||||||
|
|
||||||
|
## 联系我们
|
||||||
|
笔者时间、能力有限,且开源项目非一朝一夕之事,存在众多问题亦在所难免。使用、学习过程中有任何问题欢迎大家与我联系。
|
||||||
|
|
||||||
|
对项目有什么想法或者建议,可以加我微信拉交流群,或者创建[issues](https://gitee.com/dromara/neutrino-proxy/issues),一起完善项目
|
||||||
|
|
||||||
|
- 微信号:yuyunshize
|
||||||
|
- Email: aoshiguchen@dromara.org
|
||||||
|
- 微信二维码(添加时请备注"中微子进群"):
|
||||||
|
<img src="MyWeChatQRCode.jpeg" width="100%"/>
|
||||||
|
After Width: | Height: | Size: 175 KiB |
|
After Width: | Height: | Size: 243 KiB |
|
After Width: | Height: | Size: 164 KiB |
|
After Width: | Height: | Size: 143 KiB |
|
After Width: | Height: | Size: 132 KiB |
@@ -258,7 +258,7 @@
|
|||||||
},
|
},
|
||||||
validateDomain(rule, value, callback) {
|
validateDomain(rule, value, callback) {
|
||||||
// 匹配多级域名,例如:sub.example.com, sub.sub.example.com
|
// 匹配多级域名,例如:sub.example.com, sub.sub.example.com
|
||||||
const domainPattern = /^(?:[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9]\.)+[a-zA-Z]{2,}$/
|
const domainPattern = /^(?:[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?\.)+[A-Za-z]{2,6}$/
|
||||||
|
|
||||||
if (!value) {
|
if (!value) {
|
||||||
callback(new Error('主域名不能为空'));
|
callback(new Error('主域名不能为空'));
|
||||||
|
|||||||
@@ -51,9 +51,18 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" :label="$t('table.domainName')" width="190">
|
<el-table-column align="center" :label="$t('table.domainName')" width="190">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<div v-for="(domain, index) in scope.row.allFullDomainList" :key="index">
|
<el-dropdown v-if="scope.row.allFullDomainList" @command="handleCopy">
|
||||||
<span>{{ domain }}</span>
|
<span class="el-dropdown-link">
|
||||||
</div>
|
{{ scope.row.allFullDomainList[0] }}<i v-if="scope.row.allFullDomainList.length > 1" class="el-icon-arrow-down el-icon--right"></i>
|
||||||
|
</span>
|
||||||
|
<el-dropdown-menu slot="dropdown">
|
||||||
|
<el-dropdown-item v-for="(domain, index) in scope.row.allFullDomainList" :command="domain">{{ domain }}</el-dropdown-item>
|
||||||
|
</el-dropdown-menu>
|
||||||
|
</el-dropdown>
|
||||||
|
<div v-if="!scope.row.allFullDomainList">-</div>
|
||||||
|
<!-- <div v-if="scope.row.allFullDomainList" v-for="(domain, index) in scope.row.allFullDomainList" :key="index">-->
|
||||||
|
<!-- <span>{{ domain }}</span>-->
|
||||||
|
<!-- </div>-->
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" :label="$t('table.serverPort')" width="80">
|
<el-table-column align="center" :label="$t('table.serverPort')" width="80">
|
||||||
@@ -121,91 +130,107 @@
|
|||||||
</el-pagination>
|
</el-pagination>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible">
|
<el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" width="800px">
|
||||||
<el-form :rules="rules" ref="dataForm" :model="temp" label-position="left" label-width="120px"
|
<div style="height: 500px; overflow-y: auto;">
|
||||||
style='width: 400px; margin-left:50px;'>
|
<el-form :rules="rules" ref="dataForm" :model="temp" label-position="right" label-width="150px" inline>
|
||||||
<!-- <el-form-item :label="$t('License')" prop="licenseId">-->
|
<!-- <el-form-item :label="$t('License')" prop="licenseId">-->
|
||||||
<!-- <el-select style="width: 280px;" class="filter-item" v-model="temp.licenseId" placeholder="请选择" :disabled="dialogStatus=='update'">-->
|
<!-- <el-select style="width: 187px;" class="filter-item" v-model="temp.licenseId" placeholder="请选择" :disabled="dialogStatus=='update'">-->
|
||||||
<!-- <el-option v-for="item in licenseList" :key="item.id" :label="item.name" :value="item.id">-->
|
<!-- <el-option v-for="item in licenseList" :key="item.id" :label="item.name" :value="item.id">-->
|
||||||
<!-- </el-option>-->
|
<!-- </el-option>-->
|
||||||
<!-- </el-select>-->
|
<!-- </el-select>-->
|
||||||
<!-- </el-form-item>-->
|
<!-- </el-form-item>-->
|
||||||
|
<el-form-item :label="$t('License')" prop="licenseId">
|
||||||
<el-form-item :label="$t('License')" prop="licenseId">
|
<DropdownTable v-model="temp.licenseId" :name.sync="temp.licenseName" :tableData="licenseAuthList"
|
||||||
<DropdownTable v-model="temp.licenseId" :name.sync="temp.licenseName" :tableData="licenseAuthList"
|
@selectedData="selectedFeeItem" placeholder="请选择" :width="280" :disabled="dialogStatus === 'update'" />
|
||||||
@selectedData="selectedFeeItem" placeholder="请选择" :width="280" :disabled="dialogStatus === 'update'" />
|
<!-- <DropdownTable
|
||||||
<!-- <DropdownTable
|
:columns="countryColumns"
|
||||||
:columns="countryColumns"
|
:data="licenseList"
|
||||||
:data="licenseList"
|
v-model="temp.licenseId"
|
||||||
v-model="temp.licenseId"
|
:value="temp.licenseName"
|
||||||
:value="temp.licenseName"
|
@rowClick="selectedFeeItem"
|
||||||
@rowClick="selectedFeeItem"
|
disabled
|
||||||
disabled
|
:disabled="dialogStatus==='update'"
|
||||||
:disabled="dialogStatus==='update'"
|
style="width: 280px"
|
||||||
style="width: 280px"
|
/>-->
|
||||||
/>-->
|
</el-form-item>
|
||||||
</el-form-item>
|
<el-form-item :label="$t('协议')" prop="protocal">
|
||||||
<el-form-item :label="$t('协议')" prop="protocal">
|
<el-select style="width: 187px;" class="filter-item" v-model="temp.protocal" placeholder="请选择">
|
||||||
<el-select style="width: 280px;" class="filter-item" v-model="temp.protocal" placeholder="请选择">
|
<el-option v-for="item in protocalList" :key="item.name" :label="item.name" :value="item.name"
|
||||||
<el-option v-for="item in protocalList" :key="item.name" :label="item.name" :value="item.name"
|
:disabled="!item.enable">
|
||||||
:disabled="!item.enable">
|
</el-option>
|
||||||
</el-option>
|
</el-select>
|
||||||
</el-select>
|
</el-form-item>
|
||||||
</el-form-item>
|
<el-form-item :label="$t('服务端端口')" prop="serverPort" >
|
||||||
<el-form-item :label="$t('服务端端口')" prop="serverPort" >
|
<load-select style="width: 187px;" class="filter-item"
|
||||||
<load-select style="width: 280px;" class="filter-item"
|
v-model="temp.serverPort"
|
||||||
v-model="temp.serverPort"
|
:data="serverPortList"
|
||||||
:data="serverPortList"
|
:page="loadServerPortQuery.page"
|
||||||
:page="loadServerPortQuery.page"
|
:hasMore="more"
|
||||||
:hasMore="more"
|
:clearable="false"
|
||||||
:clearable="false"
|
:dictLabel="'port'"
|
||||||
:dictLabel="'port'"
|
:dictValue="'port'"
|
||||||
:dictValue="'port'"
|
:request="loadServerPort"/>
|
||||||
:request="loadServerPort"/>
|
</el-form-item>
|
||||||
</el-form-item>
|
<el-form-item :label="$t('客户端IP')" prop="clientIp">
|
||||||
<el-form-item :label="$t('客户端IP')" prop="clientIp">
|
<el-input v-model="temp.clientIp"></el-input>
|
||||||
<el-input v-model="temp.clientIp"></el-input>
|
</el-form-item>
|
||||||
</el-form-item>
|
<el-form-item :label="$t('客户端端口')" prop="clientPort">
|
||||||
<el-form-item :label="$t('客户端端口')" prop="clientPort">
|
<el-input v-model="temp.clientPort"></el-input>
|
||||||
<el-input v-model="temp.clientPort"></el-input>
|
</el-form-item>
|
||||||
</el-form-item>
|
<el-form-item :label="$t('响应数量')" prop="proxyResponses" v-if="temp.protocal === 'UDP'">
|
||||||
<el-form-item :label="$t('域名')" prop="domainMappings" v-if="(temp.protocal === 'HTTP' || temp.protocal === 'HTTP(S)') && domainList != null && domainList.length > 0" >
|
<el-input v-model="temp.proxyResponses"></el-input>
|
||||||
<div v-for="(domain, index) in temp.domainMappings" :key="index" class="domain-mapping">
|
</el-form-item>
|
||||||
<el-input v-model="domain.subdomain">
|
<el-form-item :label="$t('超时时间')" prop="proxyTimeoutMs" v-if="temp.protocal === 'UDP'">
|
||||||
<template slot="append">
|
<el-input v-model="temp.proxyTimeoutMs">
|
||||||
<el-select v-model="domain.domainId" placeholder="请选择主域名" style="width: 130px;">
|
<template slot="append">毫秒</template>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item :label="$t('table.securityGroup')" prop="securityGroup">
|
||||||
|
<el-select style="width: 187px;" class="filter-item" v-model="temp.securityGroupId" clearable >
|
||||||
|
<el-option v-for="item in securityGroupList" :key="item.id" :label="item.name" :value="item.id">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item :label="$t('上传限速')" prop="upLimitRate">
|
||||||
|
<el-input v-model="temp.upLimitRate" placeholder="如:10240B、500K、1M"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item :label="$t('下载限速')" prop="downLimitRate">
|
||||||
|
<el-input v-model="temp.downLimitRate" placeholder="如:10240B、500K、1M"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item :label="$t('描述')" prop="description">
|
||||||
|
<el-input v-model="temp.description" style="width: 540px;"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item :label="$t('域名')" prop="domainMappings" v-if="(temp.protocal === 'HTTP' || temp.protocal === 'HTTP(S)') && domainList != null && domainList.length > 0" >
|
||||||
|
<div class="my-tag">
|
||||||
|
<el-tag
|
||||||
|
:key="index"
|
||||||
|
v-for="(domain, index) in temp.domainMappings"
|
||||||
|
closable
|
||||||
|
:disable-transitions="false"
|
||||||
|
@close="removeDomainMapping(index)"
|
||||||
|
class="my-tag_item"
|
||||||
|
>
|
||||||
|
<el-input v-model="domain.subdomain" class="my-input"></el-input>
|
||||||
|
<el-select v-model="domain.domainId" placeholder="请选择主域名" class="my-select">
|
||||||
<el-option v-for="tmp in domainList" :key="tmp.id" :label="'.'+tmp.domain" :value="tmp.id"></el-option>
|
<el-option v-for="tmp in domainList" :key="tmp.id" :label="'.'+tmp.domain" :value="tmp.id"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
<el-button type="danger" @click="removeDomainMapping(index)" style="margin-left: 10px;">删除</el-button>
|
</el-tag>
|
||||||
</template>
|
<el-button v-if="!temp.domainMappings.length || temp.domainMappings[temp.domainMappings.length - 1].subdomain" class="button-new-tag" size="small" @click="addDomainMapping">+ 添加域名</el-button>
|
||||||
</el-input>
|
</div>
|
||||||
</div>
|
<!--<div v-for="(domain, index) in temp.domainMappings" :key="index" class="domain-mapping">
|
||||||
<el-button type="primary" @click="addDomainMapping" style="margin-top: 10px;">添加域名</el-button>
|
<el-input v-model="domain.subdomain">
|
||||||
</el-form-item>
|
<template slot="append">
|
||||||
<el-form-item :label="$t('响应数量')" prop="proxyResponses" v-if="temp.protocal === 'UDP'">
|
<el-select v-model="domain.domainId" placeholder="请选择主域名" style="width: 187px;">
|
||||||
<el-input v-model="temp.proxyResponses"></el-input>
|
<el-option v-for="tmp in domainList" :key="tmp.id" :label="'.'+tmp.domain" :value="tmp.id"></el-option>
|
||||||
</el-form-item>
|
</el-select>
|
||||||
<el-form-item :label="$t('超时时间')" prop="proxyTimeoutMs" v-if="temp.protocal === 'UDP'">
|
<el-button type="danger" @click="removeDomainMapping(index)" style="margin-left: 10px;">删除</el-button>
|
||||||
<el-input v-model="temp.proxyTimeoutMs">
|
</template>
|
||||||
<template slot="append">毫秒</template>
|
</el-input>
|
||||||
</el-input>
|
</div>
|
||||||
</el-form-item>
|
<el-button type="primary" @click="addDomainMapping" style="margin-top: 10px;">添加域名</el-button>-->
|
||||||
<el-form-item :label="$t('table.securityGroup')" prop="securityGroup">
|
</el-form-item>
|
||||||
<el-select style="width: 280px;" class="filter-item" v-model="temp.securityGroupId" clearable >
|
</el-form>
|
||||||
<el-option v-for="item in securityGroupList" :key="item.id" :label="item.name" :value="item.id">
|
</div>
|
||||||
</el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item :label="$t('上传限速')" prop="upLimitRate">
|
|
||||||
<el-input v-model="temp.upLimitRate" placeholder="如:10240B、500K、1M"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item :label="$t('下载限速')" prop="downLimitRate">
|
|
||||||
<el-input v-model="temp.downLimitRate" placeholder="如:10240B、500K、1M"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item :label="$t('描述')" prop="description">
|
|
||||||
<el-input v-model="temp.description"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button @click="
|
<el-button @click="
|
||||||
dialogFormVisible = false">{{ $t('table.cancel') }}</el-button>
|
dialogFormVisible = false">{{ $t('table.cancel') }}</el-button>
|
||||||
@@ -340,11 +365,17 @@ export default {
|
|||||||
if (value && value.length > 0) {
|
if (value && value.length > 0) {
|
||||||
for (let i = 0; i < value.length; i++) {
|
for (let i = 0; i < value.length; i++) {
|
||||||
if (!value[i].subdomain || !value[i].domainId) {
|
if (!value[i].subdomain || !value[i].domainId) {
|
||||||
return callback(new Error(`子域名和主域名都不能为空`));
|
return callback(new Error(`子域名和主域名都不能为空`))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
const set = new Set()
|
||||||
|
value.forEach(i => {
|
||||||
|
const row = this.domainList.find(d => d.id === i.domainId)
|
||||||
|
set.add(i.subdomain + '.' + row.domain)
|
||||||
|
})
|
||||||
|
if (set.size !== value.length) return callback(new Error(`域名不能重复`))
|
||||||
}
|
}
|
||||||
callback(); // 验证通过
|
callback() // 验证通过
|
||||||
},
|
},
|
||||||
trigger: ''
|
trigger: ''
|
||||||
}
|
}
|
||||||
@@ -406,6 +437,13 @@ export default {
|
|||||||
this.getAvailableDomainList()
|
this.getAvailableDomainList()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
handleCopy(text) {
|
||||||
|
navigator.clipboard.writeText(text).then(() => {
|
||||||
|
this.$message.success('复制成功')
|
||||||
|
}).catch(() => {
|
||||||
|
this.$message.error('复制失败')
|
||||||
|
})
|
||||||
|
},
|
||||||
// 添加新的域名映射
|
// 添加新的域名映射
|
||||||
addDomainMapping() {
|
addDomainMapping() {
|
||||||
let defaultDomainId = this.domainList[0].id
|
let defaultDomainId = this.domainList[0].id
|
||||||
@@ -713,3 +751,42 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.my-tag {
|
||||||
|
width: 570px;
|
||||||
|
&_item {
|
||||||
|
height: 36px;
|
||||||
|
line-height: 35px;
|
||||||
|
padding: 0 7px;
|
||||||
|
.my-input, .my-select {
|
||||||
|
width: auto;
|
||||||
|
/deep/ input {
|
||||||
|
height: 32px;
|
||||||
|
line-height: 32px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.my-input {
|
||||||
|
/deep/ input {
|
||||||
|
width: 120px;
|
||||||
|
padding: 0 6px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.my-select {
|
||||||
|
/deep/ input {
|
||||||
|
width: 110px;
|
||||||
|
border-width: 0!important;
|
||||||
|
background: #ecf5ff!important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&:first-child {
|
||||||
|
margin-right: 8px;
|
||||||
|
}
|
||||||
|
& + & {
|
||||||
|
margin-right: 8px;
|
||||||
|
margin-bottom: 6px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|||||||
@@ -28,8 +28,6 @@ public class ProxyClient {
|
|||||||
setAlias("neutrino.proxy.tunnel.jks-path", "jksPath");
|
setAlias("neutrino.proxy.tunnel.jks-path", "jksPath");
|
||||||
setAlias("neutrino.proxy.tunnel.key-store-password", "keyStorePassword");
|
setAlias("neutrino.proxy.tunnel.key-store-password", "keyStorePassword");
|
||||||
setAlias("neutrino.proxy.tunnel.license-key", "licenseKey");
|
setAlias("neutrino.proxy.tunnel.license-key", "licenseKey");
|
||||||
|
|
||||||
log.info("NeutrinoProxy Client :{}", app.cfg().get("solon.app.version"));
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package org.dromara.neutrinoproxy.client.config;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.noear.solon.Solon;
|
||||||
|
import org.noear.solon.annotation.Component;
|
||||||
|
import org.noear.solon.core.event.AppLoadEndEvent;
|
||||||
|
import org.noear.solon.core.event.EventListener;
|
||||||
|
import org.noear.solon.core.runtime.NativeDetector;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 启动成功后信息输出
|
||||||
|
* @author: aoshiguchen
|
||||||
|
* @date: 2024/10/16
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
public class AppLoadEndExecutor implements EventListener<AppLoadEndEvent> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onEvent(AppLoadEndEvent appLoadEndEvent) throws Throwable {
|
||||||
|
// aot 阶段,不执行
|
||||||
|
if (NativeDetector.isAotRuntime()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
System.out.printf("""
|
||||||
|
---------------------------------------------------------------
|
||||||
|
Neutrino Proxy Client %s
|
||||||
|
Gitee: https://gitee.com/dromara/neutrino-proxy
|
||||||
|
GitHub: https://github.com/dromara/neutrino-proxy
|
||||||
|
GitCode: https://gitcode.com/dromara/neutrino-proxy
|
||||||
|
---------------------------------------------------------------
|
||||||
|
%n""", Solon.app().cfg().get("solon.app.version"));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,6 +1,10 @@
|
|||||||
package org.dromara.neutrinoproxy.client.config;
|
package org.dromara.neutrinoproxy.client.config;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import io.netty.channel.WriteBufferWaterMark;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.dromara.neutrinoproxy.client.util.StringUtil;
|
||||||
import org.noear.solon.annotation.Component;
|
import org.noear.solon.annotation.Component;
|
||||||
import org.noear.solon.annotation.Inject;
|
import org.noear.solon.annotation.Inject;
|
||||||
|
|
||||||
@@ -9,6 +13,7 @@ import org.noear.solon.annotation.Inject;
|
|||||||
* @author: aoshiguchen
|
* @author: aoshiguchen
|
||||||
* @date: 2022/6/16
|
* @date: 2022/6/16
|
||||||
*/
|
*/
|
||||||
|
@Slf4j
|
||||||
@Data
|
@Data
|
||||||
@Component
|
@Component
|
||||||
public class ProxyConfig {
|
public class ProxyConfig {
|
||||||
@@ -29,6 +34,8 @@ public class ProxyConfig {
|
|||||||
private Integer readIdleTime;
|
private Integer readIdleTime;
|
||||||
private Integer writeIdleTime;
|
private Integer writeIdleTime;
|
||||||
private Integer allIdleTimeSeconds;
|
private Integer allIdleTimeSeconds;
|
||||||
|
// 水位线
|
||||||
|
private String waterMark;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@@ -71,4 +78,38 @@ public class ProxyConfig {
|
|||||||
private String puppetPortRange;
|
private String puppetPortRange;
|
||||||
private Boolean transferLogEnable;
|
private Boolean transferLogEnable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private WriteBufferWaterMark waterMark;
|
||||||
|
private boolean isParseWaterMark = false;
|
||||||
|
|
||||||
|
public synchronized WriteBufferWaterMark getWaterMark() {
|
||||||
|
if (isParseWaterMark) {
|
||||||
|
return waterMark;
|
||||||
|
}
|
||||||
|
isParseWaterMark = true;
|
||||||
|
if (null == protocol || StrUtil.isBlank(protocol.getWaterMark())) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
String[] tmp = protocol.getWaterMark().split("/");
|
||||||
|
if (tmp.length != 2) {
|
||||||
|
log.info("[配置解析] 水位线配置参数格式有误! config={}", protocol.getWaterMark());
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
String lowStr = tmp[0].trim();
|
||||||
|
String highStr = tmp[1].trim();
|
||||||
|
if (!StringUtil.isBytesDesc(lowStr) || !StringUtil.isBytesDesc(highStr)) {
|
||||||
|
log.info("[配置解析] 水位线配置参数格式有误! config={}", protocol.getWaterMark());
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
Long low = StringUtil.parseBytes(lowStr);
|
||||||
|
Long high = StringUtil.parseBytes(highStr);
|
||||||
|
if (null == low || null == high || low >= high) {
|
||||||
|
log.info("[配置解析] 水位线配置参数格式或大小有误! config={}", protocol.getWaterMark());
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
waterMark = new WriteBufferWaterMark(low.intValue(), high.intValue());
|
||||||
|
log.info("[配置解析] 水位线配置 config={},low={},high={}", protocol.getWaterMark(), low.intValue(), high.intValue());
|
||||||
|
return waterMark;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
package org.dromara.neutrinoproxy.client.config;
|
package org.dromara.neutrinoproxy.client.config;
|
||||||
|
|
||||||
import io.netty.channel.ChannelInitializer;
|
import io.netty.channel.*;
|
||||||
import io.netty.channel.ChannelOption;
|
|
||||||
import io.netty.channel.ChannelPipeline;
|
|
||||||
import io.netty.channel.nio.NioEventLoopGroup;
|
import io.netty.channel.nio.NioEventLoopGroup;
|
||||||
import io.netty.channel.socket.SocketChannel;
|
import io.netty.channel.socket.SocketChannel;
|
||||||
import io.netty.channel.socket.nio.NioDatagramChannel;
|
import io.netty.channel.socket.nio.NioDatagramChannel;
|
||||||
@@ -16,7 +14,6 @@ import org.dromara.neutrinoproxy.core.aot.NeutrinoCoreRuntimeNativeRegistrar;
|
|||||||
import org.dromara.neutrinoproxy.core.dispatcher.DefaultDispatcher;
|
import org.dromara.neutrinoproxy.core.dispatcher.DefaultDispatcher;
|
||||||
import org.dromara.neutrinoproxy.core.dispatcher.Dispatcher;
|
import org.dromara.neutrinoproxy.core.dispatcher.Dispatcher;
|
||||||
import io.netty.bootstrap.Bootstrap;
|
import io.netty.bootstrap.Bootstrap;
|
||||||
import io.netty.channel.ChannelHandlerContext;
|
|
||||||
import org.noear.solon.Solon;
|
import org.noear.solon.Solon;
|
||||||
import org.noear.solon.annotation.Bean;
|
import org.noear.solon.annotation.Bean;
|
||||||
import org.noear.solon.annotation.Configuration;
|
import org.noear.solon.annotation.Configuration;
|
||||||
@@ -108,6 +105,12 @@ public class ProxyConfiguration implements LifecycleBean {
|
|||||||
Bootstrap bootstrap = new Bootstrap();
|
Bootstrap bootstrap = new Bootstrap();
|
||||||
bootstrap.group(tunnelWorkGroup);
|
bootstrap.group(tunnelWorkGroup);
|
||||||
bootstrap.channel(NioSocketChannel.class);
|
bootstrap.channel(NioSocketChannel.class);
|
||||||
|
|
||||||
|
WriteBufferWaterMark waterMark = proxyConfig.getWaterMark();
|
||||||
|
if (null != waterMark) {
|
||||||
|
bootstrap.option(ChannelOption.WRITE_BUFFER_WATER_MARK, waterMark);
|
||||||
|
}
|
||||||
|
|
||||||
bootstrap.remoteAddress(InetSocketAddress.createUnresolved(proxyConfig.getTunnel().getServerIp(), proxyConfig.getTunnel().getServerPort()));
|
bootstrap.remoteAddress(InetSocketAddress.createUnresolved(proxyConfig.getTunnel().getServerIp(), proxyConfig.getTunnel().getServerPort()));
|
||||||
bootstrap.handler(new ChannelInitializer<SocketChannel>() {
|
bootstrap.handler(new ChannelInitializer<SocketChannel>() {
|
||||||
|
|
||||||
@@ -165,6 +168,12 @@ public class ProxyConfiguration implements LifecycleBean {
|
|||||||
Bootstrap bootstrap = new Bootstrap();
|
Bootstrap bootstrap = new Bootstrap();
|
||||||
bootstrap.group(tcpRealServerWorkGroup);
|
bootstrap.group(tcpRealServerWorkGroup);
|
||||||
bootstrap.channel(NioSocketChannel.class);
|
bootstrap.channel(NioSocketChannel.class);
|
||||||
|
|
||||||
|
WriteBufferWaterMark waterMark = proxyConfig.getWaterMark();
|
||||||
|
if (null != waterMark) {
|
||||||
|
bootstrap.option(ChannelOption.WRITE_BUFFER_WATER_MARK, waterMark);
|
||||||
|
}
|
||||||
|
|
||||||
bootstrap.handler(new ChannelInitializer<SocketChannel>() {
|
bootstrap.handler(new ChannelInitializer<SocketChannel>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package org.dromara.neutrinoproxy.client.core;
|
package org.dromara.neutrinoproxy.client.core;
|
||||||
|
|
||||||
|
import io.netty.handler.codec.DecoderException;
|
||||||
import org.dromara.neutrinoproxy.client.config.ProxyConfig;
|
import org.dromara.neutrinoproxy.client.config.ProxyConfig;
|
||||||
import org.dromara.neutrinoproxy.client.util.ProxyUtil;
|
import org.dromara.neutrinoproxy.client.util.ProxyUtil;
|
||||||
import org.dromara.neutrinoproxy.core.Constants;
|
import org.dromara.neutrinoproxy.core.Constants;
|
||||||
@@ -13,6 +14,9 @@ import io.netty.handler.timeout.IdleStateEvent;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.noear.solon.Solon;
|
import org.noear.solon.Solon;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.net.SocketException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 处理与服务端之间的数据传输
|
* 处理与服务端之间的数据传输
|
||||||
* @author: aoshiguchen
|
* @author: aoshiguchen
|
||||||
@@ -58,8 +62,29 @@ public class CmdChannelHandler extends SimpleChannelInboundHandler<ProxyMessage>
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
|
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
|
||||||
log.error("[CMD Channel]Client CmdChannel Error channelId:{}", ctx.channel().id().asLongText(), cause);
|
// 对于网络IO异常(致命异常),关闭channel以防止资源泄漏
|
||||||
ctx.close();
|
// 对于其他异常(可能是可恢复的业务异常),只记录日志
|
||||||
|
if (cause instanceof IOException) {
|
||||||
|
// IOException及其子类(包括SocketException)都是致命的网络异常
|
||||||
|
if (cause instanceof SocketException && cause.getMessage() != null && cause.getMessage().contains("Connection reset")) {
|
||||||
|
// Connection reset是常见的客户端断开,使用debug级别
|
||||||
|
log.debug("[Cmd Channel] Client connection reset: {}", cause.getMessage());
|
||||||
|
} else {
|
||||||
|
log.error("[Cmd Channel] IO Error", cause);
|
||||||
|
}
|
||||||
|
if (ctx.channel().isActive()) {
|
||||||
|
ctx.channel().close();
|
||||||
|
}
|
||||||
|
} else if(cause instanceof DecoderException) {
|
||||||
|
// 协议解析错误,为防止数据污染,立即关闭
|
||||||
|
log.debug("[Cmd Channel] decoder error: {}", cause.getMessage());
|
||||||
|
if (ctx.channel().isActive()) {
|
||||||
|
ctx.channel().close();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 其他异常只记录日志,不关闭channel,让Netty自己处理
|
||||||
|
log.error("[Cmd Channel] error", cause);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.client.core;
|
package org.dromara.neutrinoproxy.client.core;
|
||||||
|
|
||||||
import java.util.concurrent.ThreadFactory;
|
import java.util.concurrent.ThreadFactory;
|
||||||
|
|||||||
@@ -1,25 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.dromara.neutrinoproxy.client.core;
|
package org.dromara.neutrinoproxy.client.core;
|
||||||
|
|
||||||
import io.netty.channel.Channel;
|
import io.netty.channel.Channel;
|
||||||
|
|||||||
@@ -1,36 +1,16 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.dromara.neutrinoproxy.client.core;
|
package org.dromara.neutrinoproxy.client.core;
|
||||||
|
|
||||||
|
import io.netty.buffer.Unpooled;
|
||||||
|
import io.netty.channel.*;
|
||||||
|
import io.netty.handler.codec.DecoderException;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.dromara.neutrinoproxy.client.util.ProxyUtil;
|
import org.dromara.neutrinoproxy.client.util.ProxyUtil;
|
||||||
import org.dromara.neutrinoproxy.core.Constants;
|
import org.dromara.neutrinoproxy.core.Constants;
|
||||||
import org.dromara.neutrinoproxy.core.ProxyMessage;
|
import org.dromara.neutrinoproxy.core.ProxyMessage;
|
||||||
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBuf;
|
||||||
import io.netty.channel.Channel;
|
|
||||||
import io.netty.channel.ChannelHandlerContext;
|
import java.io.IOException;
|
||||||
import io.netty.channel.ChannelOption;
|
import java.net.SocketException;
|
||||||
import io.netty.channel.SimpleChannelInboundHandler;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 处理与被代理客户端的数据传输
|
* 处理与被代理客户端的数据传输
|
||||||
@@ -77,9 +57,10 @@ public class RealServerChannelHandler extends SimpleChannelInboundHandler<ByteBu
|
|||||||
Channel realServerChannel = ctx.channel();
|
Channel realServerChannel = ctx.channel();
|
||||||
String visitorId = ProxyUtil.getVisitorIdByRealServerChannel(realServerChannel);
|
String visitorId = ProxyUtil.getVisitorIdByRealServerChannel(realServerChannel);
|
||||||
ProxyUtil.removeRealServerChannel(visitorId);
|
ProxyUtil.removeRealServerChannel(visitorId);
|
||||||
Channel channel = realServerChannel.attr(Constants.NEXT_CHANNEL).get();
|
Channel proxyChannel = realServerChannel.attr(Constants.NEXT_CHANNEL).get();
|
||||||
if (channel != null) {
|
if (proxyChannel != null && proxyChannel.isActive()) {
|
||||||
channel.writeAndFlush(ProxyMessage.buildDisconnectMessage(visitorId));
|
// channel.writeAndFlush(ProxyMessage.buildDisconnectMessage(visitorId));
|
||||||
|
proxyChannel.writeAndFlush(Unpooled.EMPTY_BUFFER).addListener(ChannelFutureListener.CLOSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
super.channelInactive(ctx);
|
super.channelInactive(ctx);
|
||||||
@@ -98,6 +79,28 @@ public class RealServerChannelHandler extends SimpleChannelInboundHandler<ByteBu
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
|
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
|
||||||
log.error("Client ProxyChannel Error", cause);
|
// 对于网络IO异常(致命异常),关闭channel以防止资源泄漏
|
||||||
|
// 对于其他异常(可能是可恢复的业务异常),只记录日志
|
||||||
|
if (cause instanceof IOException) {
|
||||||
|
// IOException及其子类(包括SocketException)都是致命的网络异常
|
||||||
|
if (cause instanceof SocketException && cause.getMessage() != null && cause.getMessage().contains("Connection reset")) {
|
||||||
|
// Connection reset是常见的客户端断开,使用debug级别
|
||||||
|
log.debug("[Real Server Channel] Client connection reset: {}", cause.getMessage());
|
||||||
|
} else {
|
||||||
|
log.error("[Real Server Channel] IO Error", cause);
|
||||||
|
}
|
||||||
|
if (ctx.channel().isActive()) {
|
||||||
|
ctx.channel().close();
|
||||||
|
}
|
||||||
|
} else if(cause instanceof DecoderException) {
|
||||||
|
// 协议解析错误,为防止数据污染,立即关闭
|
||||||
|
log.debug("[Real Server Channel] decoder error: {}", cause.getMessage());
|
||||||
|
if (ctx.channel().isActive()) {
|
||||||
|
ctx.channel().close();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 其他异常只记录日志,不关闭channel,让Netty自己处理
|
||||||
|
log.error("[Real Server Channel] error", cause);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
package org.dromara.neutrinoproxy.client.core;
|
package org.dromara.neutrinoproxy.client.core;
|
||||||
|
|
||||||
import io.netty.channel.Channel;
|
import io.netty.buffer.Unpooled;
|
||||||
import io.netty.channel.ChannelHandlerContext;
|
import io.netty.channel.*;
|
||||||
import io.netty.channel.ChannelOption;
|
import io.netty.handler.codec.DecoderException;
|
||||||
import io.netty.channel.SimpleChannelInboundHandler;
|
|
||||||
import io.netty.handler.timeout.IdleStateEvent;
|
import io.netty.handler.timeout.IdleStateEvent;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.dromara.neutrinoproxy.client.util.ProxyUtil;
|
import org.dromara.neutrinoproxy.client.util.ProxyUtil;
|
||||||
@@ -12,6 +11,9 @@ import org.dromara.neutrinoproxy.core.ProxyMessage;
|
|||||||
import org.dromara.neutrinoproxy.core.dispatcher.Dispatcher;
|
import org.dromara.neutrinoproxy.core.dispatcher.Dispatcher;
|
||||||
import org.noear.solon.Solon;
|
import org.noear.solon.Solon;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.net.SocketException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 处理与服务端之间的数据传输
|
* 处理与服务端之间的数据传输
|
||||||
* @author: aoshiguchen
|
* @author: aoshiguchen
|
||||||
@@ -43,18 +45,43 @@ public class TcpProxyChannelHandler extends SimpleChannelInboundHandler<ProxyMes
|
|||||||
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
|
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
|
||||||
// 数据传输连接
|
// 数据传输连接
|
||||||
Channel realServerChannel = ctx.channel().attr(Constants.NEXT_CHANNEL).get();
|
Channel realServerChannel = ctx.channel().attr(Constants.NEXT_CHANNEL).get();
|
||||||
if (realServerChannel != null && realServerChannel.isActive()) {
|
if (null != realServerChannel && realServerChannel.isActive()) {
|
||||||
realServerChannel.close();
|
// realServerChannel.close();
|
||||||
|
realServerChannel.writeAndFlush(Unpooled.EMPTY_BUFFER).addListener(ChannelFutureListener.CLOSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ProxyUtil.returnTcpProxyChanel(ctx.channel());
|
||||||
|
ctx.channel().attr(Constants.NEXT_CHANNEL).remove();
|
||||||
ProxyUtil.removeTcpProxyChanel(ctx.channel());
|
ProxyUtil.removeTcpProxyChanel(ctx.channel());
|
||||||
|
|
||||||
super.channelInactive(ctx);
|
super.channelInactive(ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
|
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
|
||||||
log.error("[TCP Proxy Channel]Client ProxyChannel Error channelId:{}", ctx.channel().id().asLongText(), cause);
|
// 对于网络IO异常(致命异常),关闭channel以防止资源泄漏
|
||||||
ctx.close();
|
// 对于其他异常(可能是可恢复的业务异常),只记录日志
|
||||||
|
if (cause instanceof IOException) {
|
||||||
|
// IOException及其子类(包括SocketException)都是致命的网络异常
|
||||||
|
if (cause instanceof SocketException && cause.getMessage() != null && cause.getMessage().contains("Connection reset")) {
|
||||||
|
// Connection reset是常见的客户端断开,使用debug级别
|
||||||
|
log.debug("[TCP Proxy Channel] Client connection reset: {}", cause.getMessage());
|
||||||
|
} else {
|
||||||
|
log.error("[TCP Proxy Channel] IO Error", cause);
|
||||||
|
}
|
||||||
|
if (ctx.channel().isActive()) {
|
||||||
|
ctx.channel().close();
|
||||||
|
}
|
||||||
|
} else if(cause instanceof DecoderException) {
|
||||||
|
// 协议解析错误,为防止数据污染,立即关闭
|
||||||
|
log.debug("[TCP Proxy Channel] decoder error: {}", cause.getMessage());
|
||||||
|
if (ctx.channel().isActive()) {
|
||||||
|
ctx.channel().close();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 其他异常只记录日志,不关闭channel,让Netty自己处理
|
||||||
|
log.error("[TCP Proxy Channel] error", cause);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
package org.dromara.neutrinoproxy.client.core;
|
package org.dromara.neutrinoproxy.client.core;
|
||||||
|
|
||||||
import io.netty.channel.Channel;
|
import io.netty.buffer.Unpooled;
|
||||||
import io.netty.channel.ChannelHandlerContext;
|
import io.netty.channel.*;
|
||||||
import io.netty.channel.ChannelOption;
|
import io.netty.handler.codec.DecoderException;
|
||||||
import io.netty.channel.SimpleChannelInboundHandler;
|
|
||||||
import io.netty.handler.timeout.IdleStateEvent;
|
import io.netty.handler.timeout.IdleStateEvent;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.dromara.neutrinoproxy.client.util.ProxyUtil;
|
import org.dromara.neutrinoproxy.client.util.ProxyUtil;
|
||||||
@@ -12,6 +11,9 @@ import org.dromara.neutrinoproxy.core.ProxyMessage;
|
|||||||
import org.dromara.neutrinoproxy.core.dispatcher.Dispatcher;
|
import org.dromara.neutrinoproxy.core.dispatcher.Dispatcher;
|
||||||
import org.noear.solon.Solon;
|
import org.noear.solon.Solon;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.net.SocketException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 处理与服务端之间的数据传输
|
* 处理与服务端之间的数据传输
|
||||||
* @author: aoshiguchen
|
* @author: aoshiguchen
|
||||||
@@ -44,17 +46,40 @@ public class UdpProxyChannelHandler extends SimpleChannelInboundHandler<ProxyMes
|
|||||||
// 数据传输连接
|
// 数据传输连接
|
||||||
Channel realServerChannel = ctx.channel().attr(Constants.NEXT_CHANNEL).get();
|
Channel realServerChannel = ctx.channel().attr(Constants.NEXT_CHANNEL).get();
|
||||||
if (realServerChannel != null && realServerChannel.isActive()) {
|
if (realServerChannel != null && realServerChannel.isActive()) {
|
||||||
realServerChannel.close();
|
// realServerChannel.close();
|
||||||
|
realServerChannel.writeAndFlush(Unpooled.EMPTY_BUFFER).addListener(ChannelFutureListener.CLOSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
ProxyUtil.removeTcpProxyChanel(ctx.channel());
|
ProxyUtil.returnUdpProxyChanel(ctx.channel());
|
||||||
|
ProxyUtil.removeUdpProxyChanel(ctx.channel());
|
||||||
super.channelInactive(ctx);
|
super.channelInactive(ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
|
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
|
||||||
log.error("[UDP Proxy Channel]Client ProxyChannel Error channelId:{}", ctx.channel().id().asLongText(), cause);
|
// 对于网络IO异常(致命异常),关闭channel以防止资源泄漏
|
||||||
ctx.close();
|
// 对于其他异常(可能是可恢复的业务异常),只记录日志
|
||||||
|
if (cause instanceof IOException) {
|
||||||
|
// IOException及其子类(包括SocketException)都是致命的网络异常
|
||||||
|
if (cause instanceof SocketException && cause.getMessage() != null && cause.getMessage().contains("Connection reset")) {
|
||||||
|
// Connection reset是常见的客户端断开,使用debug级别
|
||||||
|
log.debug("[UDP Proxy Channel] Client connection reset: {}", cause.getMessage());
|
||||||
|
} else {
|
||||||
|
log.error("[UDP Proxy Channel] IO Error", cause);
|
||||||
|
}
|
||||||
|
if (ctx.channel().isActive()) {
|
||||||
|
ctx.channel().close();
|
||||||
|
}
|
||||||
|
} else if(cause instanceof DecoderException) {
|
||||||
|
// 协议解析错误,为防止数据污染,立即关闭
|
||||||
|
log.debug("[UDP Proxy Channel] decoder error: {}", cause.getMessage());
|
||||||
|
if (ctx.channel().isActive()) {
|
||||||
|
ctx.channel().close();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 其他异常只记录日志,不关闭channel,让Netty自己处理
|
||||||
|
log.error("[UDP Proxy Channel] error", cause);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -63,16 +88,18 @@ public class UdpProxyChannelHandler extends SimpleChannelInboundHandler<ProxyMes
|
|||||||
IdleStateEvent event = (IdleStateEvent)evt;
|
IdleStateEvent event = (IdleStateEvent)evt;
|
||||||
switch (event.state()) {
|
switch (event.state()) {
|
||||||
case READER_IDLE:
|
case READER_IDLE:
|
||||||
// 读超时,断开连接
|
if (ctx.channel().isWritable()) {
|
||||||
log.info("[UDP Proxy Channel]Read timeout");
|
// 读超时,断开连接
|
||||||
ctx.channel().close();
|
log.info("[UDP Proxy Channel]Read timeout");
|
||||||
|
ctx.channel().close();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case WRITER_IDLE:
|
case WRITER_IDLE:
|
||||||
ctx.channel().writeAndFlush(ProxyMessage.buildHeartbeatMessage());
|
ctx.channel().writeAndFlush(ProxyMessage.buildHeartbeatMessage());
|
||||||
break;
|
break;
|
||||||
case ALL_IDLE:
|
case ALL_IDLE:
|
||||||
log.debug("[UDP Proxy Channel]ReadWrite timeout");
|
// log.debug("[UDP Proxy Channel]ReadWrite timeout");
|
||||||
ctx.close();
|
// ctx.close();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,12 +3,16 @@ package org.dromara.neutrinoproxy.client.core;
|
|||||||
import io.netty.channel.ChannelHandlerContext;
|
import io.netty.channel.ChannelHandlerContext;
|
||||||
import io.netty.channel.SimpleChannelInboundHandler;
|
import io.netty.channel.SimpleChannelInboundHandler;
|
||||||
import io.netty.channel.socket.DatagramPacket;
|
import io.netty.channel.socket.DatagramPacket;
|
||||||
|
import io.netty.handler.codec.DecoderException;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.dromara.neutrinoproxy.client.constant.Constants;
|
import org.dromara.neutrinoproxy.client.constant.Constants;
|
||||||
import org.dromara.neutrinoproxy.client.util.UdpChannelBindInfo;
|
import org.dromara.neutrinoproxy.client.util.UdpChannelBindInfo;
|
||||||
import org.dromara.neutrinoproxy.core.ProxyMessage;
|
import org.dromara.neutrinoproxy.core.ProxyMessage;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
|
import java.net.SocketException;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author: aoshiguchen
|
* @author: aoshiguchen
|
||||||
@@ -36,6 +40,47 @@ public class UdpRealServerHandler extends SimpleChannelInboundHandler<DatagramPa
|
|||||||
);
|
);
|
||||||
|
|
||||||
udpChannelBindInfo.getLockChannel().setResponseCount(udpChannelBindInfo.getLockChannel().getResponseCount() + 1);
|
udpChannelBindInfo.getLockChannel().setResponseCount(udpChannelBindInfo.getLockChannel().getResponseCount() + 1);
|
||||||
|
udpChannelBindInfo.getLockChannel().setLastActiveTime(new Date());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
|
||||||
|
// 对于网络IO异常(致命异常),关闭channel以防止资源泄漏
|
||||||
|
// 对于其他异常(可能是可恢复的业务异常),只记录日志
|
||||||
|
if (cause instanceof IOException) {
|
||||||
|
// IOException及其子类(包括SocketException)都是致命的网络异常
|
||||||
|
if (cause instanceof SocketException && cause.getMessage() != null && cause.getMessage().contains("Connection reset")) {
|
||||||
|
// Connection reset是常见的客户端断开,使用debug级别
|
||||||
|
log.debug("[UDP RealServer Channel] Client connection reset: {}", cause.getMessage());
|
||||||
|
} else {
|
||||||
|
log.error("[UDP RealServer Channel] IO Error", cause);
|
||||||
|
}
|
||||||
|
if (ctx.channel().isActive()) {
|
||||||
|
ctx.channel().close();
|
||||||
|
}
|
||||||
|
} else if(cause instanceof DecoderException) {
|
||||||
|
// 协议解析错误,为防止数据污染,立即关闭
|
||||||
|
log.debug("[UDP RealServer Channel] decoder error: {}", cause.getMessage());
|
||||||
|
if (ctx.channel().isActive()) {
|
||||||
|
ctx.channel().close();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 其他异常只记录日志,不关闭channel,让Netty自己处理
|
||||||
|
log.error("[UDP RealServer Channel] error", cause);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Override
|
||||||
|
// public void channelInactive(ChannelHandlerContext ctx) throws Exception {
|
||||||
|
// // 数据传输连接
|
||||||
|
// Channel realServerChannel = ctx.channel().attr(org.dromara.neutrinoproxy.core.Constants.NEXT_CHANNEL).get();
|
||||||
|
// if (realServerChannel != null && realServerChannel.isActive()) {
|
||||||
|
// // realServerChannel.close();
|
||||||
|
// realServerChannel.writeAndFlush(Unpooled.EMPTY_BUFFER).addListener(ChannelFutureListener.CLOSE);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// ProxyUtil.removeUdpProxyChanel(ctx.channel());
|
||||||
|
// super.channelInactive(ctx);
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,10 @@
|
|||||||
package org.dromara.neutrinoproxy.client.handler;
|
package org.dromara.neutrinoproxy.client.handler;
|
||||||
|
|
||||||
import org.dromara.neutrinoproxy.client.util.ProxyUtil;
|
|
||||||
import org.dromara.neutrinoproxy.core.Constants;
|
import org.dromara.neutrinoproxy.core.Constants;
|
||||||
import org.dromara.neutrinoproxy.core.ProxyDataTypeEnum;
|
import org.dromara.neutrinoproxy.core.ProxyDataTypeEnum;
|
||||||
import org.dromara.neutrinoproxy.core.ProxyMessage;
|
import org.dromara.neutrinoproxy.core.ProxyMessage;
|
||||||
import org.dromara.neutrinoproxy.core.ProxyMessageHandler;
|
import org.dromara.neutrinoproxy.core.ProxyMessageHandler;
|
||||||
import org.dromara.neutrinoproxy.core.dispatcher.Match;
|
import org.dromara.neutrinoproxy.core.dispatcher.Match;
|
||||||
import io.netty.buffer.Unpooled;
|
|
||||||
import io.netty.channel.Channel;
|
|
||||||
import io.netty.channel.ChannelFutureListener;
|
|
||||||
import io.netty.channel.ChannelHandlerContext;
|
import io.netty.channel.ChannelHandlerContext;
|
||||||
import org.noear.solon.annotation.Component;
|
import org.noear.solon.annotation.Component;
|
||||||
|
|
||||||
@@ -23,12 +19,12 @@ public class ProxyMessageDisconnectHandler implements ProxyMessageHandler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void handle(ChannelHandlerContext ctx, ProxyMessage proxyMessage) {
|
public void handle(ChannelHandlerContext ctx, ProxyMessage proxyMessage) {
|
||||||
Channel realServerChannel = ctx.channel().attr(Constants.NEXT_CHANNEL).get();
|
// Channel realServerChannel = ctx.channel().attr(Constants.NEXT_CHANNEL).get();
|
||||||
if (null != realServerChannel) {
|
// if (null != realServerChannel) {
|
||||||
ctx.channel().attr(Constants.NEXT_CHANNEL).remove();
|
// ctx.channel().attr(Constants.NEXT_CHANNEL).remove();
|
||||||
ProxyUtil.returnTcpProxyChanel(ctx.channel());
|
// ProxyUtil.returnTcpProxyChanel(ctx.channel());
|
||||||
realServerChannel.writeAndFlush(Unpooled.EMPTY_BUFFER).addListener(ChannelFutureListener.CLOSE);
|
// realServerChannel.writeAndFlush(Unpooled.EMPTY_BUFFER).addListener(ChannelFutureListener.CLOSE);
|
||||||
}
|
// }
|
||||||
ctx.close();
|
ctx.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,8 @@ public class LockChannel {
|
|||||||
private long proxyTimeoutMs;
|
private long proxyTimeoutMs;
|
||||||
// 被获取的时间
|
// 被获取的时间
|
||||||
private Date takeTime;
|
private Date takeTime;
|
||||||
// 已经响应的次数
|
// 最后一次活跃的时间(最后发生读写的时间),每次发送或响应需要重置
|
||||||
|
private Date lastActiveTime;
|
||||||
|
// 已经响应的次数(相对于最后一次发送的时,每次发送后需要重置)
|
||||||
private int responseCount;
|
private int responseCount;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.client.util;
|
package org.dromara.neutrinoproxy.client.util;
|
||||||
|
|
||||||
import io.netty.channel.ChannelHandler;
|
import io.netty.channel.ChannelHandler;
|
||||||
@@ -201,8 +180,7 @@ public class ProxyUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static ChannelHandler createSslHandler(ProxyConfig proxyConfig) {
|
public static ChannelHandler createSslHandler(ProxyConfig proxyConfig) {
|
||||||
try {
|
try (InputStream jksInputStream = FileUtil.getInputStream(proxyConfig.getTunnel().getJksPath())) {
|
||||||
InputStream jksInputStream = FileUtil.getInputStream(proxyConfig.getTunnel().getJksPath());
|
|
||||||
|
|
||||||
SSLContext clientContext = SSLContext.getInstance("TLS");
|
SSLContext clientContext = SSLContext.getInstance("TLS");
|
||||||
final KeyStore ks = KeyStore.getInstance("JKS");
|
final KeyStore ks = KeyStore.getInstance("JKS");
|
||||||
|
|||||||
@@ -0,0 +1,75 @@
|
|||||||
|
package org.dromara.neutrinoproxy.client.util;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author: aoshiguchen
|
||||||
|
* @date: 2023/12/15
|
||||||
|
*/
|
||||||
|
public class StringUtil {
|
||||||
|
private static final Integer BYTES_MUL_KB = 1024;
|
||||||
|
private static final Integer BYTES_MUL_MB = BYTES_MUL_KB * 1024;
|
||||||
|
private static final Integer BYTES_MUL_GB = BYTES_MUL_MB * 1024;
|
||||||
|
private static final String[] BYTES_UNIT_STR = {"B", "K", "KB", "M", "MB", "G", "GB"};
|
||||||
|
private static final Integer[] BYTES_UNIT_MUL = {1, BYTES_MUL_KB, BYTES_MUL_KB, BYTES_MUL_MB, BYTES_MUL_MB, BYTES_MUL_GB, BYTES_MUL_GB};
|
||||||
|
private static final String BYTES_DESC_REGEX = "\\s*(\\d+\\.*\\d*)\\s*(B|K|KB|M|MB|G|GB)\\s*";
|
||||||
|
private static final Pattern BYTES_DESC_PATTERN = Pattern.compile(BYTES_DESC_REGEX);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验是否符合字节描述
|
||||||
|
* @param desc
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static boolean isBytesDesc(String desc) {
|
||||||
|
if (StrUtil.isBlank(desc)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return desc.toUpperCase().matches(BYTES_DESC_REGEX);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 解析字节数
|
||||||
|
* 支持B、K、KB、M、MB、G、GB 忽略大小写、忽略首尾空格、忽略数字与单位之间的空格
|
||||||
|
* @param desc
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static Long parseBytes(String desc) {
|
||||||
|
try {
|
||||||
|
if (!isBytesDesc(desc)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
Matcher matcher = BYTES_DESC_PATTERN.matcher(desc.toUpperCase());
|
||||||
|
boolean found = matcher.find();
|
||||||
|
if (!found) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
Double n = Double.parseDouble(matcher.group(1));
|
||||||
|
String unit = matcher.group(2);
|
||||||
|
Integer unitIndex = getBytesUnitIndex(unit);
|
||||||
|
if (null == unitIndex) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (long)(n * BYTES_UNIT_MUL[unitIndex]);
|
||||||
|
} catch (Exception e) {
|
||||||
|
// ignore
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Integer getBytesUnitIndex(String unit) {
|
||||||
|
if (StrUtil.isBlank(unit)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
for (int i = 0; i < BYTES_UNIT_STR.length; i++) {
|
||||||
|
if (unit.equals(BYTES_UNIT_STR[i])) {
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -133,28 +133,40 @@ public class UdpServerUtil {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static synchronized Channel takeChannel(ProxyMessage.UdpBaseInfo info, Channel tunnelChannel) {
|
public static synchronized Channel takeChannel(ProxyMessage.UdpBaseInfo info, Channel tunnelChannel) {
|
||||||
if (info.getProxyResponses() <= 0 || info.getProxyTimeoutMs() <= 0) {
|
Channel realServerChannel = tunnelChannel.attr(org.dromara.neutrinoproxy.core.Constants.NEXT_CHANNEL).get();
|
||||||
|
if (null != realServerChannel) {
|
||||||
|
UdpChannelBindInfo udpChannelBindInfo = realServerChannel.attr(Constants.UDP_CHANNEL_BIND_KEY).get();
|
||||||
|
// 每次发送前重置
|
||||||
|
udpChannelBindInfo.getLockChannel().setResponseCount(0);
|
||||||
|
udpChannelBindInfo.getLockChannel().setLastActiveTime(new Date());
|
||||||
|
|
||||||
|
return realServerChannel;
|
||||||
|
}
|
||||||
|
// 响应数量为零、超时时间<=0,则不需要响应(注意:响应数量为-1 则不限制响应数量)
|
||||||
|
if (info.getProxyResponses() == 0 || info.getProxyTimeoutMs() <= 0) {
|
||||||
return defaultUdpServerChannel;
|
return defaultUdpServerChannel;
|
||||||
}
|
}
|
||||||
|
// 没有空闲的 傀儡端口,降级为不需要响应
|
||||||
Integer port = udpServerFreePortPool.poll();
|
Integer port = udpServerFreePortPool.poll();
|
||||||
if (null == port) {
|
if (null == port) {
|
||||||
return defaultUdpServerChannel;
|
return defaultUdpServerChannel;
|
||||||
}
|
}
|
||||||
Channel channel = portToChannelMap.get(port);
|
realServerChannel = portToChannelMap.get(port);
|
||||||
if (null == channel) {
|
if (null == realServerChannel) {
|
||||||
channel = bindPort(port);
|
realServerChannel = bindPort(port);
|
||||||
portToChannelMap.put(port, channel);
|
portToChannelMap.put(port, realServerChannel);
|
||||||
}
|
}
|
||||||
// 添加到锁定队列
|
// 添加到锁定队列
|
||||||
LockChannel lockChannel = new LockChannel()
|
LockChannel lockChannel = new LockChannel()
|
||||||
.setPort(port)
|
.setPort(port)
|
||||||
.setChannel(channel)
|
.setChannel(realServerChannel)
|
||||||
.setProxyResponses(info.getProxyResponses())
|
.setProxyResponses(info.getProxyResponses())
|
||||||
.setProxyTimeoutMs(info.getProxyTimeoutMs())
|
.setProxyTimeoutMs(info.getProxyTimeoutMs())
|
||||||
.setTakeTime(new Date())
|
.setTakeTime(new Date())
|
||||||
|
.setLastActiveTime(new Date())
|
||||||
.setResponseCount(0);
|
.setResponseCount(0);
|
||||||
lockChannelList.add(lockChannel);
|
lockChannelList.add(lockChannel);
|
||||||
channel.attr(Constants.UDP_CHANNEL_BIND_KEY).set(new UdpChannelBindInfo()
|
realServerChannel.attr(Constants.UDP_CHANNEL_BIND_KEY).set(new UdpChannelBindInfo()
|
||||||
.setTunnelChannel(tunnelChannel)
|
.setTunnelChannel(tunnelChannel)
|
||||||
.setVisitorId(info.getVisitorId())
|
.setVisitorId(info.getVisitorId())
|
||||||
.setVisitorIp(info.getVisitorIp())
|
.setVisitorIp(info.getVisitorIp())
|
||||||
@@ -164,7 +176,12 @@ public class UdpServerUtil {
|
|||||||
.setTargetPort(info.getTargetPort())
|
.setTargetPort(info.getTargetPort())
|
||||||
.setLockChannel(lockChannel)
|
.setLockChannel(lockChannel)
|
||||||
);
|
);
|
||||||
return channel;
|
|
||||||
|
// 连接绑定
|
||||||
|
realServerChannel.attr(org.dromara.neutrinoproxy.core.Constants.NEXT_CHANNEL).set(tunnelChannel);
|
||||||
|
tunnelChannel.attr(org.dromara.neutrinoproxy.core.Constants.NEXT_CHANNEL).set(realServerChannel);
|
||||||
|
|
||||||
|
return realServerChannel;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -177,8 +194,8 @@ public class UdpServerUtil {
|
|||||||
Iterator<LockChannel> iter = lockChannelList.iterator();
|
Iterator<LockChannel> iter = lockChannelList.iterator();
|
||||||
if (iter.hasNext()) {
|
if (iter.hasNext()) {
|
||||||
LockChannel lockChannel = iter.next();
|
LockChannel lockChannel = iter.next();
|
||||||
if (lockChannel.getResponseCount() >= lockChannel.getProxyResponses() ||
|
if ((lockChannel.getProxyResponses() > 0 && lockChannel.getResponseCount() >= lockChannel.getProxyResponses()) ||
|
||||||
System.currentTimeMillis() - lockChannel.getTakeTime().getTime() >= lockChannel.getProxyTimeoutMs()
|
System.currentTimeMillis() - lockChannel.getLastActiveTime().getTime() > lockChannel.getProxyTimeoutMs()
|
||||||
) {
|
) {
|
||||||
iter.remove();
|
iter.remove();
|
||||||
UdpChannelBindInfo udpChannelBindInfo = lockChannel.getChannel().attr(Constants.UDP_CHANNEL_BIND_KEY).get();
|
UdpChannelBindInfo udpChannelBindInfo = lockChannel.getChannel().attr(Constants.UDP_CHANNEL_BIND_KEY).get();
|
||||||
@@ -186,6 +203,17 @@ public class UdpServerUtil {
|
|||||||
closeChannel(udpChannelBindInfo.getTunnelChannel());
|
closeChannel(udpChannelBindInfo.getTunnelChannel());
|
||||||
lockChannel.getChannel().attr(Constants.UDP_CHANNEL_BIND_KEY).set(null);
|
lockChannel.getChannel().attr(Constants.UDP_CHANNEL_BIND_KEY).set(null);
|
||||||
udpServerFreePortPool.offer(lockChannel.getPort());
|
udpServerFreePortPool.offer(lockChannel.getPort());
|
||||||
|
|
||||||
|
// 连接解绑
|
||||||
|
Channel realServerChannel = lockChannel.getChannel();
|
||||||
|
Channel tunnelChannel = realServerChannel.attr(org.dromara.neutrinoproxy.core.Constants.NEXT_CHANNEL).get();
|
||||||
|
if (null != realServerChannel) {
|
||||||
|
realServerChannel.attr(org.dromara.neutrinoproxy.core.Constants.NEXT_CHANNEL).set(null);
|
||||||
|
}
|
||||||
|
if (null != tunnelChannel) {
|
||||||
|
tunnelChannel.attr(org.dromara.neutrinoproxy.core.Constants.NEXT_CHANNEL).set(null);
|
||||||
|
}
|
||||||
|
|
||||||
log.debug("[udp channel]release udp channel port:{}", lockChannel.getPort());
|
log.debug("[udp channel]release udp channel port:{}", lockChannel.getPort());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,9 @@ solon.logging.logger:
|
|||||||
|
|
||||||
neutrino:
|
neutrino:
|
||||||
proxy:
|
proxy:
|
||||||
|
protocol:
|
||||||
|
# 高低水位线,如:32KB/64KB、32KB/1MB、1MB/5MB
|
||||||
|
# water-mark: 1MB/8MB
|
||||||
tunnel:
|
tunnel:
|
||||||
# 线程池相关配置,用于技术调优,可忽略
|
# 线程池相关配置,用于技术调优,可忽略
|
||||||
thread-count: 50
|
thread-count: 50
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ solon:
|
|||||||
add: ./app.yml
|
add: ./app.yml
|
||||||
app:
|
app:
|
||||||
name: neutrino-proxy-client
|
name: neutrino-proxy-client
|
||||||
version: 2.0.1
|
version: 2.0.4
|
||||||
# 日志级别
|
# 日志级别
|
||||||
solon.logging.appender:
|
solon.logging.appender:
|
||||||
console:
|
console:
|
||||||
@@ -31,6 +31,8 @@ neutrino:
|
|||||||
read-idle-time: 120
|
read-idle-time: 120
|
||||||
write-idle-time: 20
|
write-idle-time: 20
|
||||||
all-idle-time-seconds: 0
|
all-idle-time-seconds: 0
|
||||||
|
# 高低水位线,如:32KB/64KB、32KB/1MB、1MB/5MB
|
||||||
|
# water-mark: 1MB/8MB
|
||||||
tunnel:
|
tunnel:
|
||||||
# 线程池相关配置,用于技术调优,可忽略
|
# 线程池相关配置,用于技术调优,可忽略
|
||||||
thread-count: 50
|
thread-count: 50
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.core;
|
package org.dromara.neutrinoproxy.core;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|||||||
@@ -1,31 +1,10 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.dromara.neutrinoproxy.core;
|
package org.dromara.neutrinoproxy.core;
|
||||||
|
|
||||||
import io.netty.channel.Channel;
|
import io.netty.channel.Channel;
|
||||||
import io.netty.util.AttributeKey;
|
import io.netty.util.AttributeKey;
|
||||||
|
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
|
import java.util.function.BiConsumer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -55,6 +34,8 @@ public interface Constants {
|
|||||||
|
|
||||||
AttributeKey<Boolean> FLOW_LIMITER_FLAG = AttributeKey.newInstance("flowLimiterFlag");
|
AttributeKey<Boolean> FLOW_LIMITER_FLAG = AttributeKey.newInstance("flowLimiterFlag");
|
||||||
|
|
||||||
|
AttributeKey<ProxyAttachment> PROXY_CONNECT_ATTACHMENT = AttributeKey.newInstance("proxyConnectAttachment");;
|
||||||
|
|
||||||
|
|
||||||
int HEADER_SIZE = 4;
|
int HEADER_SIZE = 4;
|
||||||
int TYPE_SIZE = 1;
|
int TYPE_SIZE = 1;
|
||||||
@@ -73,4 +54,20 @@ public interface Constants {
|
|||||||
String ERROR = "ERROR";
|
String ERROR = "ERROR";
|
||||||
String PORT_MAPPING_SYNC = "PORT_MAPPING_SYNC";
|
String PORT_MAPPING_SYNC = "PORT_MAPPING_SYNC";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class ProxyAttachment {
|
||||||
|
private byte[] bytes;
|
||||||
|
private BiConsumer<Channel, byte[]> executor;
|
||||||
|
|
||||||
|
public ProxyAttachment(byte[] bytes, BiConsumer<Channel, byte[]> executor) {
|
||||||
|
this.bytes = bytes;
|
||||||
|
this.executor = executor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void execute(Channel channel) {
|
||||||
|
if (null != executor && null != channel && channel.isActive()) {
|
||||||
|
this.executor.accept(channel, bytes);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,25 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.dromara.neutrinoproxy.core;
|
package org.dromara.neutrinoproxy.core;
|
||||||
|
|
||||||
import io.netty.channel.ChannelHandlerContext;
|
import io.netty.channel.ChannelHandlerContext;
|
||||||
|
|||||||
@@ -1,25 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.dromara.neutrinoproxy.core;
|
package org.dromara.neutrinoproxy.core;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,25 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.dromara.neutrinoproxy.core;
|
package org.dromara.neutrinoproxy.core;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
|||||||
@@ -1,25 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.dromara.neutrinoproxy.core;
|
package org.dromara.neutrinoproxy.core;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,25 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.dromara.neutrinoproxy.core;
|
package org.dromara.neutrinoproxy.core;
|
||||||
|
|
||||||
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBuf;
|
||||||
|
|||||||
@@ -1,25 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.dromara.neutrinoproxy.core;
|
package org.dromara.neutrinoproxy.core;
|
||||||
|
|
||||||
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBuf;
|
||||||
|
|||||||
@@ -1,25 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.dromara.neutrinoproxy.core.base;
|
package org.dromara.neutrinoproxy.core.base;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
|
|
||||||
|
|
||||||
package org.dromara.neutrinoproxy.core.base;
|
package org.dromara.neutrinoproxy.core.base;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,25 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.dromara.neutrinoproxy.core.dispatcher;
|
package org.dromara.neutrinoproxy.core.dispatcher;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,25 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.dromara.neutrinoproxy.core.dispatcher;
|
package org.dromara.neutrinoproxy.core.dispatcher;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,25 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.dromara.neutrinoproxy.core.dispatcher;
|
package org.dromara.neutrinoproxy.core.dispatcher;
|
||||||
|
|
||||||
import java.lang.annotation.*;
|
import java.lang.annotation.*;
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
package org.dromara.neutrinoproxy.core.type;
|
package org.dromara.neutrinoproxy.core.type;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -37,8 +37,17 @@ public class HttpUtil {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static String getHeaderValue(String httpContent, String header) {
|
public static String getHeaderValue(String httpContent, String header) {
|
||||||
|
if (!httpContent.contains("\r\n\r\n")) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
String headerContent = httpContent.split("\r\n\r\n")[0];
|
String headerContent = httpContent.split("\r\n\r\n")[0];
|
||||||
|
if (!headerContent.contains("\r\n")) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
String[] lines = headerContent.split("\r\n");
|
String[] lines = headerContent.split("\r\n");
|
||||||
|
if (lines.length == 0) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
String firstLine = lines[0];
|
String firstLine = lines[0];
|
||||||
if (!(firstLine.endsWith("HTTP/1.1") || firstLine.endsWith("HTTP/1.0"))) {
|
if (!(firstLine.endsWith("HTTP/1.1") || firstLine.endsWith("HTTP/1.0"))) {
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ public class ProxyServer {
|
|||||||
if (Utils.isNotEmpty(loglevel)) {
|
if (Utils.isNotEmpty(loglevel)) {
|
||||||
app.cfg().put("solon.logging.logger.root.level", loglevel);
|
app.cfg().put("solon.logging.logger.root.level", loglevel);
|
||||||
}
|
}
|
||||||
log.info("NeutrinoProxy Server :{}", app.cfg().get("solon.app.version"));
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package org.dromara.neutrinoproxy.server.base;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.noear.solon.Solon;
|
||||||
|
import org.noear.solon.annotation.Component;
|
||||||
|
import org.noear.solon.core.event.AppLoadEndEvent;
|
||||||
|
import org.noear.solon.core.event.EventListener;
|
||||||
|
import org.noear.solon.core.runtime.NativeDetector;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 启动成功后信息输出
|
||||||
|
* @author: aoshiguchen
|
||||||
|
* @date: 2024/10/16
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
public class AppLoadEndExecutor implements EventListener<AppLoadEndEvent> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onEvent(AppLoadEndEvent appLoadEndEvent) throws Throwable {
|
||||||
|
// aot 阶段,不执行
|
||||||
|
if (NativeDetector.isAotRuntime()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
System.out.printf("""
|
||||||
|
---------------------------------------------------------------
|
||||||
|
Neutrino Proxy Server %s
|
||||||
|
admin: http://localhost:%s
|
||||||
|
account: admin/123456
|
||||||
|
Gitee: https://gitee.com/dromara/neutrino-proxy
|
||||||
|
GitHub: https://github.com/dromara/neutrino-proxy
|
||||||
|
GitCode: https://gitcode.com/dromara/neutrino-proxy
|
||||||
|
---------------------------------------------------------------
|
||||||
|
%n""", Solon.app().cfg().get("solon.app.version"),
|
||||||
|
Solon.app().cfg().get("server.port"));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.base.db;
|
package org.dromara.neutrinoproxy.server.base.db;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.base.db;
|
package org.dromara.neutrinoproxy.server.base.db;
|
||||||
|
|
||||||
import org.dromara.neutrinoproxy.server.constant.DbTypeEnum;
|
import org.dromara.neutrinoproxy.server.constant.DbTypeEnum;
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
package org.dromara.neutrinoproxy.server.base.proxy;
|
package org.dromara.neutrinoproxy.server.base.proxy;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import io.netty.channel.WriteBufferWaterMark;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.dromara.neutrinoproxy.server.util.StringUtil;
|
||||||
import org.noear.solon.annotation.Component;
|
import org.noear.solon.annotation.Component;
|
||||||
import org.noear.solon.annotation.Inject;
|
import org.noear.solon.annotation.Inject;
|
||||||
|
|
||||||
@@ -9,6 +13,7 @@ import org.noear.solon.annotation.Inject;
|
|||||||
* @author: aoshiguchen
|
* @author: aoshiguchen
|
||||||
* @date: 2022/6/16
|
* @date: 2022/6/16
|
||||||
*/
|
*/
|
||||||
|
@Slf4j
|
||||||
@Data
|
@Data
|
||||||
@Component
|
@Component
|
||||||
public class ProxyConfig {
|
public class ProxyConfig {
|
||||||
@@ -38,6 +43,8 @@ public class ProxyConfig {
|
|||||||
private Integer readIdleTime;
|
private Integer readIdleTime;
|
||||||
private Integer writeIdleTime;
|
private Integer writeIdleTime;
|
||||||
private Integer allIdleTimeSeconds;
|
private Integer allIdleTimeSeconds;
|
||||||
|
// 水位线
|
||||||
|
private String waterMark;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@@ -76,4 +83,37 @@ public class ProxyConfig {
|
|||||||
private Integer workThreadCount;
|
private Integer workThreadCount;
|
||||||
private Boolean transferLogEnable;
|
private Boolean transferLogEnable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private WriteBufferWaterMark waterMark;
|
||||||
|
private boolean isParseWaterMark = false;
|
||||||
|
|
||||||
|
public synchronized WriteBufferWaterMark getWaterMark() {
|
||||||
|
if (isParseWaterMark) {
|
||||||
|
return waterMark;
|
||||||
|
}
|
||||||
|
isParseWaterMark = true;
|
||||||
|
if (null == protocol || StrUtil.isBlank(protocol.getWaterMark())) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
String[] tmp = protocol.getWaterMark().split("/");
|
||||||
|
if (tmp.length != 2) {
|
||||||
|
log.info("[配置解析] 水位线配置参数格式有误! config={}", protocol.getWaterMark());
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
String lowStr = tmp[0].trim();
|
||||||
|
String highStr = tmp[1].trim();
|
||||||
|
if (!StringUtil.isBytesDesc(lowStr) || !StringUtil.isBytesDesc(highStr)) {
|
||||||
|
log.info("[配置解析] 水位线配置参数格式有误! config={}", protocol.getWaterMark());
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
Long low = StringUtil.parseBytes(lowStr);
|
||||||
|
Long high = StringUtil.parseBytes(highStr);
|
||||||
|
if (null == low || null == high || low >= high) {
|
||||||
|
log.info("[配置解析] 水位线配置参数格式或大小有误! config={}", protocol.getWaterMark());
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
waterMark = new WriteBufferWaterMark(low.intValue(), high.intValue());
|
||||||
|
log.info("[配置解析] 水位线配置 config={},low={},high={}", protocol.getWaterMark(), low.intValue(), high.intValue());
|
||||||
|
return waterMark;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
package org.dromara.neutrinoproxy.server.base.proxy;
|
package org.dromara.neutrinoproxy.server.base.proxy;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import io.netty.bootstrap.Bootstrap;
|
import io.netty.bootstrap.Bootstrap;
|
||||||
import io.netty.bootstrap.ServerBootstrap;
|
import io.netty.bootstrap.ServerBootstrap;
|
||||||
import io.netty.channel.ChannelInitializer;
|
import io.netty.channel.*;
|
||||||
import io.netty.channel.ChannelOption;
|
|
||||||
import io.netty.channel.ChannelPipeline;
|
|
||||||
import io.netty.channel.socket.SocketChannel;
|
import io.netty.channel.socket.SocketChannel;
|
||||||
import io.netty.channel.socket.nio.NioDatagramChannel;
|
import io.netty.channel.socket.nio.NioDatagramChannel;
|
||||||
import io.netty.channel.socket.nio.NioServerSocketChannel;
|
import io.netty.channel.socket.nio.NioServerSocketChannel;
|
||||||
@@ -15,14 +14,13 @@ import org.dromara.neutrinoproxy.core.ProxyMessageHandler;
|
|||||||
import org.dromara.neutrinoproxy.core.aot.NeutrinoCoreRuntimeNativeRegistrar;
|
import org.dromara.neutrinoproxy.core.aot.NeutrinoCoreRuntimeNativeRegistrar;
|
||||||
import org.dromara.neutrinoproxy.core.dispatcher.DefaultDispatcher;
|
import org.dromara.neutrinoproxy.core.dispatcher.DefaultDispatcher;
|
||||||
import org.dromara.neutrinoproxy.core.dispatcher.Dispatcher;
|
import org.dromara.neutrinoproxy.core.dispatcher.Dispatcher;
|
||||||
import io.netty.channel.ChannelHandlerContext;
|
|
||||||
import io.netty.channel.nio.NioEventLoopGroup;
|
import io.netty.channel.nio.NioEventLoopGroup;
|
||||||
import org.dromara.neutrinoproxy.server.proxy.core.BytesMetricsHandler;
|
|
||||||
import org.dromara.neutrinoproxy.server.proxy.core.TcpVisitorChannelHandler;
|
import org.dromara.neutrinoproxy.server.proxy.core.TcpVisitorChannelHandler;
|
||||||
import org.dromara.neutrinoproxy.server.proxy.core.UdpVisitorChannelHandler;
|
import org.dromara.neutrinoproxy.server.proxy.core.UdpVisitorChannelHandler;
|
||||||
import org.dromara.neutrinoproxy.server.proxy.security.TcpVisitorSecurityChannelHandler;
|
import org.dromara.neutrinoproxy.server.proxy.security.TcpVisitorSecurityChannelHandler;
|
||||||
import org.dromara.neutrinoproxy.server.proxy.security.UdpVisitorSecurityChannelHandler;
|
import org.dromara.neutrinoproxy.server.proxy.security.UdpVisitorSecurityChannelHandler;
|
||||||
import org.dromara.neutrinoproxy.server.proxy.security.VisitorFlowLimiterChannelHandler;
|
import org.dromara.neutrinoproxy.server.proxy.security.VisitorFlowLimiterChannelHandler;
|
||||||
|
import org.dromara.neutrinoproxy.server.util.ProxyUtil;
|
||||||
import org.noear.solon.Solon;
|
import org.noear.solon.Solon;
|
||||||
import org.noear.solon.annotation.Bean;
|
import org.noear.solon.annotation.Bean;
|
||||||
import org.noear.solon.annotation.Configuration;
|
import org.noear.solon.annotation.Configuration;
|
||||||
@@ -47,6 +45,8 @@ public class ProxyConfiguration implements LifecycleBean {
|
|||||||
null : ProxyDataTypeEnum.of((int)proxyMessage.getType()).getName());
|
null : ProxyDataTypeEnum.of((int)proxyMessage.getType()).getName());
|
||||||
|
|
||||||
Solon.context().wrapAndPut(Dispatcher.class, dispatcher);
|
Solon.context().wrapAndPut(Dispatcher.class, dispatcher);
|
||||||
|
|
||||||
|
ProxyUtil.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean("tcpServerBossGroup")
|
@Bean("tcpServerBossGroup")
|
||||||
@@ -67,6 +67,11 @@ public class ProxyConfiguration implements LifecycleBean {
|
|||||||
@Inject ProxyConfig proxyConfig
|
@Inject ProxyConfig proxyConfig
|
||||||
) {
|
) {
|
||||||
ServerBootstrap bootstrap = new ServerBootstrap();
|
ServerBootstrap bootstrap = new ServerBootstrap();
|
||||||
|
|
||||||
|
WriteBufferWaterMark waterMark = proxyConfig.getWaterMark();
|
||||||
|
if (null != waterMark) {
|
||||||
|
bootstrap.childOption(ChannelOption.WRITE_BUFFER_WATER_MARK, waterMark);
|
||||||
|
}
|
||||||
bootstrap.group(tcpServerBossGroup, tcpServerWorkerGroup)
|
bootstrap.group(tcpServerBossGroup, tcpServerWorkerGroup)
|
||||||
.channel(NioServerSocketChannel.class)
|
.channel(NioServerSocketChannel.class)
|
||||||
.childHandler(new ChannelInitializer<SocketChannel>() {
|
.childHandler(new ChannelInitializer<SocketChannel>() {
|
||||||
@@ -75,7 +80,7 @@ public class ProxyConfiguration implements LifecycleBean {
|
|||||||
if (null != proxyConfig.getServer().getTcp().getTransferLogEnable() && proxyConfig.getServer().getTcp().getTransferLogEnable()) {
|
if (null != proxyConfig.getServer().getTcp().getTransferLogEnable() && proxyConfig.getServer().getTcp().getTransferLogEnable()) {
|
||||||
ch.pipeline().addFirst(new LoggingHandler(TcpVisitorChannelHandler.class));
|
ch.pipeline().addFirst(new LoggingHandler(TcpVisitorChannelHandler.class));
|
||||||
}
|
}
|
||||||
ch.pipeline().addFirst(new BytesMetricsHandler());
|
// ch.pipeline().addFirst(new BytesMetricsHandler());
|
||||||
// ch.pipeline().addLast(new ChannelTrafficShapingHandler(1024 * 1024 * 20, 1024 * 1024 * 20, 100, 20000));
|
// ch.pipeline().addLast(new ChannelTrafficShapingHandler(1024 * 1024 * 20, 1024 * 1024 * 20, 100, 20000));
|
||||||
ch.pipeline().addLast(new TcpVisitorSecurityChannelHandler());
|
ch.pipeline().addLast(new TcpVisitorSecurityChannelHandler());
|
||||||
ch.pipeline().addLast("flowLimiter", new VisitorFlowLimiterChannelHandler());
|
ch.pipeline().addLast("flowLimiter", new VisitorFlowLimiterChannelHandler());
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.base.rest;
|
package org.dromara.neutrinoproxy.server.base.rest;
|
||||||
|
|
||||||
import java.lang.annotation.ElementType;
|
import java.lang.annotation.ElementType;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.base.rest;
|
package org.dromara.neutrinoproxy.server.base.rest;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.base.rest;
|
package org.dromara.neutrinoproxy.server.base.rest;
|
||||||
|
|
||||||
import org.dromara.neutrinoproxy.server.constant.ExceptionConstant;
|
import org.dromara.neutrinoproxy.server.constant.ExceptionConstant;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.base.rest;
|
package org.dromara.neutrinoproxy.server.base.rest;
|
||||||
|
|
||||||
import org.dromara.neutrinoproxy.server.dal.entity.UserDO;
|
import org.dromara.neutrinoproxy.server.dal.entity.UserDO;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.base.rest;
|
package org.dromara.neutrinoproxy.server.base.rest;
|
||||||
|
|
||||||
import org.dromara.neutrinoproxy.server.dal.entity.UserDO;
|
import org.dromara.neutrinoproxy.server.dal.entity.UserDO;
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import org.dromara.neutrinoproxy.server.dal.entity.UserDO;
|
|||||||
import org.dromara.neutrinoproxy.server.service.UserService;
|
import org.dromara.neutrinoproxy.server.service.UserService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.exception.ExceptionUtils;
|
import org.apache.commons.lang3.exception.ExceptionUtils;
|
||||||
import org.dromara.neutrinoproxy.server.base.rest.*;
|
|
||||||
import org.noear.solon.Solon;
|
import org.noear.solon.Solon;
|
||||||
import org.noear.solon.annotation.Component;
|
import org.noear.solon.annotation.Component;
|
||||||
import org.noear.solon.core.handle.Action;
|
import org.noear.solon.core.handle.Action;
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ public class GlobalExceptionFilter implements Filter {
|
|||||||
try {
|
try {
|
||||||
chain.doFilter(ctx);
|
chain.doFilter(ctx);
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
log.error("global error", e);
|
log.debug("global error", e);
|
||||||
|
|
||||||
if (e instanceof ServiceException) {
|
if (e instanceof ServiceException) {
|
||||||
ServiceException serviceException = (ServiceException) e;
|
ServiceException serviceException = (ServiceException) e;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.constant;
|
package org.dromara.neutrinoproxy.server.constant;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.constant;
|
package org.dromara.neutrinoproxy.server.constant;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.constant;
|
package org.dromara.neutrinoproxy.server.constant;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.constant;
|
package org.dromara.neutrinoproxy.server.constant;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.constant;
|
package org.dromara.neutrinoproxy.server.constant;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.constant;
|
package org.dromara.neutrinoproxy.server.constant;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.constant;
|
package org.dromara.neutrinoproxy.server.constant;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.constant;
|
package org.dromara.neutrinoproxy.server.constant;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.controller;
|
package org.dromara.neutrinoproxy.server.controller;
|
||||||
|
|
||||||
import org.dromara.neutrinoproxy.server.base.page.PageInfo;
|
import org.dromara.neutrinoproxy.server.base.page.PageInfo;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.controller;
|
package org.dromara.neutrinoproxy.server.controller;
|
||||||
|
|
||||||
import org.dromara.neutrinoproxy.server.base.rest.Authorization;
|
import org.dromara.neutrinoproxy.server.base.rest.Authorization;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.controller;
|
package org.dromara.neutrinoproxy.server.controller;
|
||||||
|
|
||||||
import org.dromara.neutrinoproxy.server.base.page.PageInfo;
|
import org.dromara.neutrinoproxy.server.base.page.PageInfo;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.controller;
|
package org.dromara.neutrinoproxy.server.controller;
|
||||||
|
|
||||||
import org.dromara.neutrinoproxy.server.base.page.PageInfo;
|
import org.dromara.neutrinoproxy.server.base.page.PageInfo;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.controller;
|
package org.dromara.neutrinoproxy.server.controller;
|
||||||
|
|
||||||
import org.dromara.neutrinoproxy.server.base.page.PageInfo;
|
import org.dromara.neutrinoproxy.server.base.page.PageInfo;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.controller;
|
package org.dromara.neutrinoproxy.server.controller;
|
||||||
|
|
||||||
import org.dromara.neutrinoproxy.server.base.page.PageInfo;
|
import org.dromara.neutrinoproxy.server.base.page.PageInfo;
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package org.dromara.neutrinoproxy.server.controller;
|
||||||
|
|
||||||
|
import org.dromara.neutrinoproxy.server.base.rest.Authorization;
|
||||||
|
import org.dromara.neutrinoproxy.server.controller.res.stats.StatsInfoRes;
|
||||||
|
import org.dromara.neutrinoproxy.server.util.ProxyUtil;
|
||||||
|
import org.noear.solon.annotation.Controller;
|
||||||
|
import org.noear.solon.annotation.Get;
|
||||||
|
import org.noear.solon.annotation.Mapping;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author: wen.y
|
||||||
|
* @date: 2026/1/20
|
||||||
|
*/
|
||||||
|
@Mapping("/stats")
|
||||||
|
@Controller
|
||||||
|
public class StatsController {
|
||||||
|
|
||||||
|
@Authorization(login = false)
|
||||||
|
@Get
|
||||||
|
@Mapping("/info")
|
||||||
|
public StatsInfoRes info() {
|
||||||
|
return new StatsInfoRes().setCacheInfo(ProxyUtil.getCacheInfo());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.controller;
|
package org.dromara.neutrinoproxy.server.controller;
|
||||||
|
|
||||||
import org.dromara.neutrinoproxy.server.base.page.PageInfo;
|
import org.dromara.neutrinoproxy.server.base.page.PageInfo;
|
||||||
@@ -28,13 +7,11 @@ import org.dromara.neutrinoproxy.server.base.rest.SystemContextHolder;
|
|||||||
import org.dromara.neutrinoproxy.server.constant.ExceptionConstant;
|
import org.dromara.neutrinoproxy.server.constant.ExceptionConstant;
|
||||||
import org.dromara.neutrinoproxy.server.controller.req.system.*;
|
import org.dromara.neutrinoproxy.server.controller.req.system.*;
|
||||||
import org.dromara.neutrinoproxy.server.controller.res.system.*;
|
import org.dromara.neutrinoproxy.server.controller.res.system.*;
|
||||||
import org.dromara.neutrinoproxy.server.controller.res.system.*;
|
|
||||||
import org.dromara.neutrinoproxy.server.dal.UserMapper;
|
import org.dromara.neutrinoproxy.server.dal.UserMapper;
|
||||||
import org.dromara.neutrinoproxy.server.dal.entity.UserDO;
|
import org.dromara.neutrinoproxy.server.dal.entity.UserDO;
|
||||||
import org.dromara.neutrinoproxy.server.service.UserService;
|
import org.dromara.neutrinoproxy.server.service.UserService;
|
||||||
import org.dromara.neutrinoproxy.server.util.Md5Util;
|
import org.dromara.neutrinoproxy.server.util.Md5Util;
|
||||||
import org.dromara.neutrinoproxy.server.util.ParamCheckUtil;
|
import org.dromara.neutrinoproxy.server.util.ParamCheckUtil;
|
||||||
import org.dromara.neutrinoproxy.server.controller.req.system.*;
|
|
||||||
import org.noear.solon.annotation.*;
|
import org.noear.solon.annotation.*;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.controller;
|
package org.dromara.neutrinoproxy.server.controller;
|
||||||
|
|
||||||
import org.dromara.neutrinoproxy.server.base.page.PageInfo;
|
import org.dromara.neutrinoproxy.server.base.page.PageInfo;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.controller.req.log;
|
package org.dromara.neutrinoproxy.server.controller.req.log;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.controller.req.log;
|
package org.dromara.neutrinoproxy.server.controller.req.log;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.controller.req.log;
|
package org.dromara.neutrinoproxy.server.controller.req.log;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,15 +1,6 @@
|
|||||||
package org.dromara.neutrinoproxy.server.controller.req.proxy;
|
package org.dromara.neutrinoproxy.server.controller.req.proxy;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.dromara.neutrinoproxy.server.constant.DefaultDomainStatusEnum;
|
|
||||||
import org.dromara.neutrinoproxy.server.constant.EnableStatusEnum;
|
|
||||||
import org.dromara.neutrinoproxy.server.constant.HttpsStatusEnum;
|
|
||||||
import org.noear.solon.core.handle.UploadedFile;
|
|
||||||
import org.noear.solon.lang.Nullable;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Mirac
|
* @author Mirac
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.controller.req.proxy;
|
package org.dromara.neutrinoproxy.server.controller.req.proxy;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.controller.req.proxy;
|
package org.dromara.neutrinoproxy.server.controller.req.proxy;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.controller.req.proxy;
|
package org.dromara.neutrinoproxy.server.controller.req.proxy;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.controller.req.proxy;
|
package org.dromara.neutrinoproxy.server.controller.req.proxy;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.controller.req.proxy;
|
package org.dromara.neutrinoproxy.server.controller.req.proxy;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.controller.req.proxy;
|
package org.dromara.neutrinoproxy.server.controller.req.proxy;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.controller.req.proxy;
|
package org.dromara.neutrinoproxy.server.controller.req.proxy;
|
||||||
|
|
||||||
import org.dromara.neutrinoproxy.server.constant.EnableStatusEnum;
|
import org.dromara.neutrinoproxy.server.constant.EnableStatusEnum;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.controller.req.proxy;
|
package org.dromara.neutrinoproxy.server.controller.req.proxy;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.controller.req.proxy;
|
package org.dromara.neutrinoproxy.server.controller.req.proxy;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.controller.req.system;
|
package org.dromara.neutrinoproxy.server.controller.req.system;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.controller.req.system;
|
package org.dromara.neutrinoproxy.server.controller.req.system;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.controller.req.system;
|
package org.dromara.neutrinoproxy.server.controller.req.system;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.controller.req.system;
|
package org.dromara.neutrinoproxy.server.controller.req.system;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.controller.req.system;
|
package org.dromara.neutrinoproxy.server.controller.req.system;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.controller.req.system;
|
package org.dromara.neutrinoproxy.server.controller.req.system;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.controller.req.system;
|
package org.dromara.neutrinoproxy.server.controller.req.system;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.controller.req.system;
|
package org.dromara.neutrinoproxy.server.controller.req.system;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.controller.req.system;
|
package org.dromara.neutrinoproxy.server.controller.req.system;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.controller.req.system;
|
package org.dromara.neutrinoproxy.server.controller.req.system;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.controller.req.system;
|
package org.dromara.neutrinoproxy.server.controller.req.system;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,31 +1,18 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.controller.req.system;
|
package org.dromara.neutrinoproxy.server.controller.req.system;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户列表请求
|
* 用户列表请求
|
||||||
* @author: aoshiguchen
|
* @author: aoshiguchen
|
||||||
* @date: 2022/8/14
|
* @date: 2022/8/14
|
||||||
*/
|
*/
|
||||||
|
@Data
|
||||||
public class UserListReq {
|
public class UserListReq {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户名
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.controller.req.system;
|
package org.dromara.neutrinoproxy.server.controller.req.system;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.controller.req.system;
|
package org.dromara.neutrinoproxy.server.controller.req.system;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.controller.req.system;
|
package org.dromara.neutrinoproxy.server.controller.req.system;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.controller.res.log;
|
package org.dromara.neutrinoproxy.server.controller.res.log;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.controller.res.log;
|
package org.dromara.neutrinoproxy.server.controller.res.log;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.controller.res.log;
|
package org.dromara.neutrinoproxy.server.controller.res.log;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.controller.res.proxy;
|
package org.dromara.neutrinoproxy.server.controller.res.proxy;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.controller.res.proxy;
|
package org.dromara.neutrinoproxy.server.controller.res.proxy;
|
||||||
|
|
||||||
import org.dromara.neutrinoproxy.server.constant.EnableStatusEnum;
|
import org.dromara.neutrinoproxy.server.constant.EnableStatusEnum;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.controller.res.proxy;
|
package org.dromara.neutrinoproxy.server.controller.res.proxy;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.controller.res.proxy;
|
package org.dromara.neutrinoproxy.server.controller.res.proxy;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.controller.res.proxy;
|
package org.dromara.neutrinoproxy.server.controller.res.proxy;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.controller.res.proxy;
|
package org.dromara.neutrinoproxy.server.controller.res.proxy;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.controller.res.proxy;
|
package org.dromara.neutrinoproxy.server.controller.res.proxy;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.controller.res.proxy;
|
package org.dromara.neutrinoproxy.server.controller.res.proxy;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package org.dromara.neutrinoproxy.server.controller.res.stats;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author: wen.y
|
||||||
|
* @date: 2026/1/20
|
||||||
|
*/
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@Data
|
||||||
|
public class StatsInfoRes {
|
||||||
|
private CacheInfo cacheInfo;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class CacheInfo {
|
||||||
|
private Integer proxyInfoMapSize;
|
||||||
|
private Integer serverPortToCmdChannelMapSize;
|
||||||
|
private Integer licenseToCmdChannelMapSize;
|
||||||
|
private Integer serverPortToVisitorChannelMapSize;
|
||||||
|
private Integer proxyConnectAttachmentMapSize;
|
||||||
|
private Integer fullDomainToServerPortMapSize;
|
||||||
|
private Integer domainToDomainNameIdMapSize;
|
||||||
|
private Integer licenseIdToClientIdMapSize;
|
||||||
|
private Integer visitorIdToSocketAddressMapSize;
|
||||||
|
private Integer socketAddressToVisitorIdMapSize;
|
||||||
|
private Integer visitorIdToTunnelChannelMapSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.controller.res.system;
|
package org.dromara.neutrinoproxy.server.controller.res.system;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.controller.res.system;
|
package org.dromara.neutrinoproxy.server.controller.res.system;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.controller.res.system;
|
package org.dromara.neutrinoproxy.server.controller.res.system;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.controller.res.system;
|
package org.dromara.neutrinoproxy.server.controller.res.system;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.controller.res.system;
|
package org.dromara.neutrinoproxy.server.controller.res.system;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.controller.res.system;
|
package org.dromara.neutrinoproxy.server.controller.res.system;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.controller.res.system;
|
package org.dromara.neutrinoproxy.server.controller.res.system;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.controller.res.system;
|
package org.dromara.neutrinoproxy.server.controller.res.system;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.controller.res.system;
|
package org.dromara.neutrinoproxy.server.controller.res.system;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.controller.res.system;
|
package org.dromara.neutrinoproxy.server.controller.res.system;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.controller.res.system;
|
package org.dromara.neutrinoproxy.server.controller.res.system;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.controller.res.system;
|
package org.dromara.neutrinoproxy.server.controller.res.system;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.controller.res.system;
|
package org.dromara.neutrinoproxy.server.controller.res.system;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.controller.res.system;
|
package org.dromara.neutrinoproxy.server.controller.res.system;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -28,10 +28,10 @@ public interface DomainMapper extends BaseMapper<DomainNameDO> {
|
|||||||
if (existingDomain.equals(domain)) {
|
if (existingDomain.equals(domain)) {
|
||||||
return domainNameDO;
|
return domainNameDO;
|
||||||
}
|
}
|
||||||
// 是子域名关系
|
// // 是子域名关系
|
||||||
if (isSubdomainOrEqual(existingDomain, domain)) {
|
// if (isSubdomainOrEqual(existingDomain, domain)) {
|
||||||
return domainNameDO;
|
// return domainNameDO;
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
// 如果没有找到重复的,返回 null
|
// 如果没有找到重复的,返回 null
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.job;
|
package org.dromara.neutrinoproxy.server.job;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
|||||||
@@ -1,25 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.dromara.neutrinoproxy.server.proxy.core;
|
package org.dromara.neutrinoproxy.server.proxy.core;
|
||||||
|
|
||||||
import org.dromara.neutrinoproxy.server.proxy.domain.MetricsCollector;
|
import org.dromara.neutrinoproxy.server.proxy.domain.MetricsCollector;
|
||||||
|
|||||||
@@ -1,27 +1,6 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.dromara.neutrinoproxy.server.proxy.core;
|
package org.dromara.neutrinoproxy.server.proxy.core;
|
||||||
|
|
||||||
|
import io.netty.handler.codec.DecoderException;
|
||||||
import org.dromara.neutrinoproxy.core.Constants;
|
import org.dromara.neutrinoproxy.core.Constants;
|
||||||
import org.dromara.neutrinoproxy.core.ProxyMessage;
|
import org.dromara.neutrinoproxy.core.ProxyMessage;
|
||||||
import org.dromara.neutrinoproxy.core.dispatcher.Dispatcher;
|
import org.dromara.neutrinoproxy.core.dispatcher.Dispatcher;
|
||||||
@@ -39,7 +18,9 @@ import io.netty.handler.timeout.IdleStateEvent;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.noear.solon.Solon;
|
import org.noear.solon.Solon;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
|
import java.net.SocketException;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -73,6 +54,7 @@ public class ProxyTunnelChannelHandler extends SimpleChannelInboundHandler<Proxy
|
|||||||
Channel visitorChannel = ctx.channel().attr(Constants.NEXT_CHANNEL).get();
|
Channel visitorChannel = ctx.channel().attr(Constants.NEXT_CHANNEL).get();
|
||||||
if (visitorChannel != null) {
|
if (visitorChannel != null) {
|
||||||
visitorChannel.config().setOption(ChannelOption.AUTO_READ, ctx.channel().isWritable());
|
visitorChannel.config().setOption(ChannelOption.AUTO_READ, ctx.channel().isWritable());
|
||||||
|
// visitorChannel.config().setAutoRead(ctx.channel().isWritable());
|
||||||
}
|
}
|
||||||
|
|
||||||
super.channelWritabilityChanged(ctx);
|
super.channelWritabilityChanged(ctx);
|
||||||
@@ -80,6 +62,13 @@ public class ProxyTunnelChannelHandler extends SimpleChannelInboundHandler<Proxy
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
|
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
|
||||||
|
{
|
||||||
|
// udp情况下不能使用visitorChannel上的visitorId,因为所有的用户都是走的同一个VisitorChannel
|
||||||
|
String visitorId = ctx.channel().attr(Constants.VISITOR_ID).get();
|
||||||
|
// 删除Udp的SocketAddress
|
||||||
|
ProxyUtil.removeSocketAddressByVisitorId(visitorId);
|
||||||
|
}
|
||||||
|
|
||||||
Channel visitorChannel = ctx.channel().attr(Constants.NEXT_CHANNEL).get();
|
Channel visitorChannel = ctx.channel().attr(Constants.NEXT_CHANNEL).get();
|
||||||
if (null != visitorChannel) {
|
if (null != visitorChannel) {
|
||||||
Integer licenseId = ctx.channel().attr(Constants.LICENSE_ID).get();
|
Integer licenseId = ctx.channel().attr(Constants.LICENSE_ID).get();
|
||||||
@@ -96,7 +85,7 @@ public class ProxyTunnelChannelHandler extends SimpleChannelInboundHandler<Proxy
|
|||||||
if (visitorChannel.isActive() && null == isUdp) {
|
if (visitorChannel.isActive() && null == isUdp) {
|
||||||
// 数据发送完成后再关闭连接,解决http1.0数据传输问题
|
// 数据发送完成后再关闭连接,解决http1.0数据传输问题
|
||||||
visitorChannel.writeAndFlush(Unpooled.EMPTY_BUFFER).addListener(ChannelFutureListener.CLOSE);
|
visitorChannel.writeAndFlush(Unpooled.EMPTY_BUFFER).addListener(ChannelFutureListener.CLOSE);
|
||||||
visitorChannel.close();
|
// visitorChannel.close();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
CmdChannelAttachInfo cmdChannelAttachInfo = ProxyUtil.getAttachInfo(ctx.channel());
|
CmdChannelAttachInfo cmdChannelAttachInfo = ProxyUtil.getAttachInfo(ctx.channel());
|
||||||
@@ -126,11 +115,29 @@ public class ProxyTunnelChannelHandler extends SimpleChannelInboundHandler<Proxy
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
|
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
|
||||||
// super.exceptionCaught(ctx, cause);
|
// 对于网络IO异常(致命异常),关闭channel以防止资源泄漏
|
||||||
// if (ctx.channel().isActive()) {
|
// 对于其他异常(可能是可恢复的业务异常),只记录日志
|
||||||
// ctx.channel().close();
|
if (cause instanceof IOException) {
|
||||||
// }
|
// IOException及其子类(包括SocketException)都是致命的网络异常
|
||||||
log.error("[Tunnel Channel] error", cause);
|
if (cause instanceof SocketException && cause.getMessage() != null && cause.getMessage().contains("Connection reset")) {
|
||||||
|
// Connection reset是常见的客户端断开,使用debug级别
|
||||||
|
log.debug("[Tunnel Channel] Connection reset: {}", cause.getMessage());
|
||||||
|
} else {
|
||||||
|
log.error("[Tunnel Channel] IO error", cause);
|
||||||
|
}
|
||||||
|
if (ctx.channel().isActive()) {
|
||||||
|
ctx.channel().close();
|
||||||
|
}
|
||||||
|
} else if(cause instanceof DecoderException) {
|
||||||
|
// 协议解析错误,为防止数据污染,立即关闭
|
||||||
|
log.debug("[Tunnel Channel] decoder error: {}", cause.getMessage());
|
||||||
|
if (ctx.channel().isActive()) {
|
||||||
|
ctx.channel().close();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 其他异常只记录日志,不关闭channel,让Netty自己处理
|
||||||
|
log.error("[Tunnel Channel] error", cause);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package org.dromara.neutrinoproxy.server.proxy.core;
|
package org.dromara.neutrinoproxy.server.proxy.core;
|
||||||
|
|
||||||
|
import io.netty.channel.ChannelOption;
|
||||||
|
import io.netty.channel.WriteBufferWaterMark;
|
||||||
import io.netty.handler.logging.LoggingHandler;
|
import io.netty.handler.logging.LoggingHandler;
|
||||||
import org.dromara.neutrinoproxy.core.ProxyMessageDecoder;
|
import org.dromara.neutrinoproxy.core.ProxyMessageDecoder;
|
||||||
import org.dromara.neutrinoproxy.core.ProxyMessageEncoder;
|
import org.dromara.neutrinoproxy.core.ProxyMessageEncoder;
|
||||||
@@ -54,6 +56,12 @@ public class ProxyTunnelServer implements EventListener<AppLoadEndEvent> {
|
|||||||
*/
|
*/
|
||||||
private void startProxyServer() {
|
private void startProxyServer() {
|
||||||
ServerBootstrap bootstrap = new ServerBootstrap();
|
ServerBootstrap bootstrap = new ServerBootstrap();
|
||||||
|
|
||||||
|
WriteBufferWaterMark waterMark = proxyConfig.getWaterMark();
|
||||||
|
if (null != waterMark) {
|
||||||
|
bootstrap.childOption(ChannelOption.WRITE_BUFFER_WATER_MARK, waterMark);
|
||||||
|
}
|
||||||
|
|
||||||
bootstrap.group(serverBossGroup, serverWorkerGroup).channel(NioServerSocketChannel.class).childHandler(new ChannelInitializer<SocketChannel>() {
|
bootstrap.group(serverBossGroup, serverWorkerGroup).channel(NioServerSocketChannel.class).childHandler(new ChannelInitializer<SocketChannel>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -91,8 +99,7 @@ public class ProxyTunnelServer implements EventListener<AppLoadEndEvent> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private ChannelHandler createSslHandler() {
|
private ChannelHandler createSslHandler() {
|
||||||
try {
|
try (InputStream jksInputStream = FileUtil.getInputStream(proxyConfig.getTunnel().getJksPath())) {
|
||||||
InputStream jksInputStream = FileUtil.getInputStream(proxyConfig.getTunnel().getJksPath());
|
|
||||||
SSLContext serverContext = SSLContext.getInstance("TLS");
|
SSLContext serverContext = SSLContext.getInstance("TLS");
|
||||||
final KeyStore ks = KeyStore.getInstance("JKS");
|
final KeyStore ks = KeyStore.getInstance("JKS");
|
||||||
|
|
||||||
|
|||||||
@@ -2,10 +2,9 @@ package org.dromara.neutrinoproxy.server.proxy.core;
|
|||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBuf;
|
||||||
import io.netty.channel.Channel;
|
import io.netty.buffer.Unpooled;
|
||||||
import io.netty.channel.ChannelHandlerContext;
|
import io.netty.channel.*;
|
||||||
import io.netty.channel.ChannelOption;
|
import io.netty.handler.codec.DecoderException;
|
||||||
import io.netty.channel.SimpleChannelInboundHandler;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.dromara.neutrinoproxy.core.Constants;
|
import org.dromara.neutrinoproxy.core.Constants;
|
||||||
import org.dromara.neutrinoproxy.core.ProxyMessage;
|
import org.dromara.neutrinoproxy.core.ProxyMessage;
|
||||||
@@ -15,7 +14,9 @@ import org.dromara.neutrinoproxy.server.service.FlowReportService;
|
|||||||
import org.dromara.neutrinoproxy.server.util.ProxyUtil;
|
import org.dromara.neutrinoproxy.server.util.ProxyUtil;
|
||||||
import org.noear.solon.Solon;
|
import org.noear.solon.Solon;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
|
import java.net.SocketException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -27,9 +28,29 @@ public class TcpVisitorChannelHandler extends SimpleChannelInboundHandler<ByteBu
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
|
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
|
||||||
// 当出现异常就关闭连接
|
// 对于网络IO异常(致命异常),关闭channel以防止资源泄漏
|
||||||
ctx.close();
|
// 对于其他异常(可能是可恢复的业务异常),只记录日志
|
||||||
log.error("VisitorChannel error", cause);
|
if (cause instanceof IOException) {
|
||||||
|
// IOException及其子类(包括SocketException)都是致命的网络异常
|
||||||
|
if (cause instanceof SocketException && cause.getMessage() != null && cause.getMessage().contains("Connection reset")) {
|
||||||
|
// Connection reset是常见的客户端断开,使用debug级别
|
||||||
|
log.debug("[TCP Visitor Channel] connection reset: {}", cause.getMessage());
|
||||||
|
} else {
|
||||||
|
log.error("[TCP Visitor Channel] IO error", cause);
|
||||||
|
}
|
||||||
|
if (ctx.channel().isActive()) {
|
||||||
|
ctx.channel().close();
|
||||||
|
}
|
||||||
|
} else if(cause instanceof DecoderException) {
|
||||||
|
// 协议解析错误,为防止数据污染,立即关闭
|
||||||
|
log.debug("[TCP Visitor Channel] decoder error: {}", cause.getMessage());
|
||||||
|
if (ctx.channel().isActive()) {
|
||||||
|
ctx.channel().close();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 其他异常只记录日志,不关闭channel,让Netty自己处理
|
||||||
|
log.error("[TCP Visitor Channel] error", cause);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -95,11 +116,7 @@ public class TcpVisitorChannelHandler extends SimpleChannelInboundHandler<ByteBu
|
|||||||
InetSocketAddress sa = (InetSocketAddress) visitorChannel.localAddress();
|
InetSocketAddress sa = (InetSocketAddress) visitorChannel.localAddress();
|
||||||
Channel cmdChannel = ProxyUtil.getCmdChannelByServerPort(sa.getPort());
|
Channel cmdChannel = ProxyUtil.getCmdChannelByServerPort(sa.getPort());
|
||||||
|
|
||||||
if (null == cmdChannel) {
|
if (null != cmdChannel) {
|
||||||
// 该端口还没有代理客户端
|
|
||||||
ctx.channel().close();
|
|
||||||
} else {
|
|
||||||
|
|
||||||
// 用户连接断开,从控制连接中移除
|
// 用户连接断开,从控制连接中移除
|
||||||
String visitorId = ProxyUtil.getVisitorIdByChannel(visitorChannel);
|
String visitorId = ProxyUtil.getVisitorIdByChannel(visitorChannel);
|
||||||
ProxyUtil.removeVisitorChannelFromCmdChannel(cmdChannel, visitorId);
|
ProxyUtil.removeVisitorChannelFromCmdChannel(cmdChannel, visitorId);
|
||||||
@@ -116,6 +133,8 @@ public class TcpVisitorChannelHandler extends SimpleChannelInboundHandler<ByteBu
|
|||||||
proxyChannel.config().setOption(ChannelOption.AUTO_READ, true);
|
proxyChannel.config().setOption(ChannelOption.AUTO_READ, true);
|
||||||
// 通知客户端,用户连接已经断开
|
// 通知客户端,用户连接已经断开
|
||||||
proxyChannel.writeAndFlush(ProxyMessage.buildDisconnectMessage(visitorId));
|
proxyChannel.writeAndFlush(ProxyMessage.buildDisconnectMessage(visitorId));
|
||||||
|
|
||||||
|
proxyChannel.writeAndFlush(Unpooled.EMPTY_BUFFER).addListener(ChannelFutureListener.CLOSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -138,6 +157,7 @@ public class TcpVisitorChannelHandler extends SimpleChannelInboundHandler<ByteBu
|
|||||||
Channel proxyChannel = visitorChannel.attr(Constants.NEXT_CHANNEL).get();
|
Channel proxyChannel = visitorChannel.attr(Constants.NEXT_CHANNEL).get();
|
||||||
if (null != proxyChannel) {
|
if (null != proxyChannel) {
|
||||||
proxyChannel.config().setOption(ChannelOption.AUTO_READ, visitorChannel.isWritable());
|
proxyChannel.config().setOption(ChannelOption.AUTO_READ, visitorChannel.isWritable());
|
||||||
|
// proxyChannel.config().setAutoRead(visitorChannel.isWritable());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.dromara.neutrinoproxy.core.Constants;
|
import org.dromara.neutrinoproxy.core.Constants;
|
||||||
import org.dromara.neutrinoproxy.core.ProxyMessage;
|
import org.dromara.neutrinoproxy.core.ProxyMessage;
|
||||||
import org.dromara.neutrinoproxy.server.constant.NetworkProtocolEnum;
|
import org.dromara.neutrinoproxy.server.constant.NetworkProtocolEnum;
|
||||||
import org.dromara.neutrinoproxy.server.proxy.domain.ProxyAttachment;
|
|
||||||
import org.dromara.neutrinoproxy.server.proxy.domain.VisitorChannelAttachInfo;
|
import org.dromara.neutrinoproxy.server.proxy.domain.VisitorChannelAttachInfo;
|
||||||
import org.dromara.neutrinoproxy.server.service.FlowReportService;
|
import org.dromara.neutrinoproxy.server.service.FlowReportService;
|
||||||
import org.dromara.neutrinoproxy.server.util.ProxyUtil;
|
import org.dromara.neutrinoproxy.server.util.ProxyUtil;
|
||||||
@@ -33,8 +32,13 @@ public class UdpVisitorChannelHandler extends SimpleChannelInboundHandler<Datagr
|
|||||||
byte[] bytes = new byte[datagramPacket.content().readableBytes()];
|
byte[] bytes = new byte[datagramPacket.content().readableBytes()];
|
||||||
datagramPacket.content().readBytes(bytes);
|
datagramPacket.content().readBytes(bytes);
|
||||||
datagramPacket.content().resetReaderIndex();
|
datagramPacket.content().resetReaderIndex();
|
||||||
ProxyAttachment proxyAttachment = new ProxyAttachment(ctx.channel(), bytes, (channel, buf) -> {
|
Constants.ProxyAttachment proxyAttachment = new Constants.ProxyAttachment(bytes, (channel, buf) -> {
|
||||||
Channel proxyChannel = channel.attr(Constants.NEXT_CHANNEL).get();
|
String visitorId = ProxyUtil.getVisitorIdBySocketAddress(datagramPacket.sender());
|
||||||
|
if (StrUtil.isBlank(visitorId)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Channel proxyChannel = ProxyUtil.getTunnelChannelByVisitorId(visitorId);
|
||||||
|
// Channel proxyChannel = channel.attr(Constants.NEXT_CHANNEL).get();
|
||||||
|
|
||||||
if (null == proxyChannel) {
|
if (null == proxyChannel) {
|
||||||
// // 该端口还没有代理客户端
|
// // 该端口还没有代理客户端
|
||||||
@@ -49,7 +53,6 @@ public class UdpVisitorChannelHandler extends SimpleChannelInboundHandler<Datagr
|
|||||||
Long proxyTimeoutMs = proxyChannel.attr(Constants.PROXY_TIMEOUT_MS).get();
|
Long proxyTimeoutMs = proxyChannel.attr(Constants.PROXY_TIMEOUT_MS).get();
|
||||||
|
|
||||||
// 转发代理数据
|
// 转发代理数据
|
||||||
String visitorId = ProxyUtil.getVisitorIdByChannel(channel);
|
|
||||||
proxyChannel.writeAndFlush(ProxyMessage.buildUdpTransferMessage(new ProxyMessage.UdpBaseInfo()
|
proxyChannel.writeAndFlush(ProxyMessage.buildUdpTransferMessage(new ProxyMessage.UdpBaseInfo()
|
||||||
.setVisitorId(visitorId)
|
.setVisitorId(visitorId)
|
||||||
.setVisitorIp(datagramPacket.sender().getAddress().getHostAddress())
|
.setVisitorIp(datagramPacket.sender().getAddress().getHostAddress())
|
||||||
@@ -65,10 +68,11 @@ public class UdpVisitorChannelHandler extends SimpleChannelInboundHandler<Datagr
|
|||||||
Solon.context().getBean(FlowReportService.class).addWriteByte(visitorChannelAttachInfo.getLicenseId(), bytes.length);
|
Solon.context().getBean(FlowReportService.class).addWriteByte(visitorChannelAttachInfo.getLicenseId(), bytes.length);
|
||||||
});
|
});
|
||||||
|
|
||||||
Channel proxyChannel = ctx.channel().attr(Constants.NEXT_CHANNEL).get();
|
String visitorId = ProxyUtil.getVisitorIdBySocketAddress(datagramPacket.sender());
|
||||||
if (null != proxyChannel && proxyChannel.isActive()) {
|
Channel proxyChannel = ProxyUtil.getTunnelChannelByVisitorId(visitorId);
|
||||||
|
if (StrUtil.isNotBlank(visitorId) && null != proxyChannel && proxyChannel.isActive()) {
|
||||||
// UDP代理隧道已就绪,直接转发
|
// UDP代理隧道已就绪,直接转发
|
||||||
proxyAttachment.execute();
|
proxyAttachment.execute(ctx.channel());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -95,8 +99,10 @@ public class UdpVisitorChannelHandler extends SimpleChannelInboundHandler<Datagr
|
|||||||
// // 用户连接到代理服务器时,设置用户连接不可读,等待代理后端服务器连接成功后再改变为可读状态
|
// // 用户连接到代理服务器时,设置用户连接不可读,等待代理后端服务器连接成功后再改变为可读状态
|
||||||
// visitorChannel.config().setOption(ChannelOption.AUTO_READ, false);
|
// visitorChannel.config().setOption(ChannelOption.AUTO_READ, false);
|
||||||
|
|
||||||
// TODO UDP此处叫visitor似有不妥,与TCP不同,2.x重构思考
|
// UDP场景下,一个visitorId并不对应一个visitorChannel,所有visitor共用一个visitorChannel
|
||||||
String visitorId = ProxyUtil.newVisitorId();
|
visitorId = ProxyUtil.newVisitorId();
|
||||||
|
// 设置udp发送方的地址
|
||||||
|
ProxyUtil.setVisitorIdToSocketAddressMap(visitorId, datagramPacket.sender());
|
||||||
// 此处需要和tcp分开
|
// 此处需要和tcp分开
|
||||||
ProxyUtil.addVisitorChannelToCmdChannel(NetworkProtocolEnum.UDP, cmdChannel, visitorId, visitorChannel, sa.getPort());
|
ProxyUtil.addVisitorChannelToCmdChannel(NetworkProtocolEnum.UDP, cmdChannel, visitorId, visitorChannel, sa.getPort());
|
||||||
ProxyUtil.addProxyConnectAttachment(visitorId, proxyAttachment);
|
ProxyUtil.addProxyConnectAttachment(visitorId, proxyAttachment);
|
||||||
@@ -105,6 +111,7 @@ public class UdpVisitorChannelHandler extends SimpleChannelInboundHandler<Datagr
|
|||||||
.setServerPort(sa.getPort())
|
.setServerPort(sa.getPort())
|
||||||
.setTargetIp(targetIp)
|
.setTargetIp(targetIp)
|
||||||
.setTargetPort(targetPort)
|
.setTargetPort(targetPort)
|
||||||
|
// connect消息没有传超时时间、响应数量,导致客户端日志输出的超时时间、响应数量都是0
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -113,12 +120,32 @@ public class UdpVisitorChannelHandler extends SimpleChannelInboundHandler<Datagr
|
|||||||
super.channelActive(ctx);
|
super.channelActive(ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
// @Override
|
||||||
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
|
// public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
|
||||||
// 当出现异常就关闭连接
|
// // 对于网络IO异常(致命异常),关闭channel以防止资源泄漏
|
||||||
ctx.close();
|
// // 对于其他异常(可能是可恢复的业务异常),只记录日志
|
||||||
log.error("[UDP Visitor Channel]VisitorChannel error", cause);
|
// if (cause instanceof IOException) {
|
||||||
}
|
// // IOException及其子类(包括SocketException)都是致命的网络异常
|
||||||
|
// if (cause instanceof SocketException && cause.getMessage() != null && cause.getMessage().contains("Connection reset")) {
|
||||||
|
// // Connection reset是常见的客户端断开,使用debug级别
|
||||||
|
// log.debug("[UDP Visitor Channel] Connection reset: {}", cause.getMessage());
|
||||||
|
// } else {
|
||||||
|
// log.error("[UDP Visitor Channel] IO error", cause);
|
||||||
|
// }
|
||||||
|
// if (ctx.channel().isActive()) {
|
||||||
|
// ctx.channel().close();
|
||||||
|
// }
|
||||||
|
// } else if(cause instanceof DecoderException) {
|
||||||
|
// // 协议解析错误,为防止数据污染,立即关闭
|
||||||
|
// log.debug("[UDP Visitor Channel] decoder error: {}", cause.getMessage());
|
||||||
|
// if (ctx.channel().isActive()) {
|
||||||
|
// ctx.channel().close();
|
||||||
|
// }
|
||||||
|
// } else {
|
||||||
|
// // 其他异常只记录日志,不关闭channel,让Netty自己处理
|
||||||
|
// log.error("[UDP Visitor Channel] error", cause);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void channelWritabilityChanged(ChannelHandlerContext ctx) throws Exception {
|
public void channelWritabilityChanged(ChannelHandlerContext ctx) throws Exception {
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.proxy.domain;
|
package org.dromara.neutrinoproxy.server.proxy.domain;
|
||||||
|
|
||||||
import io.netty.channel.Channel;
|
import io.netty.channel.Channel;
|
||||||
|
|||||||
@@ -1,25 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.dromara.neutrinoproxy.server.proxy.domain;
|
package org.dromara.neutrinoproxy.server.proxy.domain;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|||||||
@@ -1,29 +1,28 @@
|
|||||||
package org.dromara.neutrinoproxy.server.proxy.domain;
|
//package org.dromara.neutrinoproxy.server.proxy.domain;
|
||||||
|
//
|
||||||
import io.netty.buffer.ByteBuf;
|
//import io.netty.channel.Channel;
|
||||||
import io.netty.channel.Channel;
|
//
|
||||||
|
//import java.util.function.BiConsumer;
|
||||||
import java.util.function.BiConsumer;
|
//
|
||||||
|
///**
|
||||||
/**
|
// * 代理连接附件
|
||||||
* 代理连接附件
|
// * @author: aoshiguchen
|
||||||
* @author: aoshiguchen
|
// * @date: 2023/4/2
|
||||||
* @date: 2023/4/2
|
// */
|
||||||
*/
|
//public class ProxyAttachment {
|
||||||
public class ProxyAttachment {
|
// private Channel channel;
|
||||||
private Channel channel;
|
// private byte[] bytes;
|
||||||
private byte[] bytes;
|
// private BiConsumer<Channel, byte[]> executor;
|
||||||
private BiConsumer<Channel, byte[]> executor;
|
//
|
||||||
|
// public ProxyAttachment(Channel channel, byte[] bytes, BiConsumer<Channel, byte[]> executor) {
|
||||||
public ProxyAttachment(Channel channel, byte[] bytes, BiConsumer<Channel, byte[]> executor) {
|
// this.channel = channel;
|
||||||
this.channel = channel;
|
// this.bytes = bytes;
|
||||||
this.bytes = bytes;
|
// this.executor = executor;
|
||||||
this.executor = executor;
|
// }
|
||||||
}
|
//
|
||||||
|
// public void execute() {
|
||||||
public void execute() {
|
// if (null != executor) {
|
||||||
if (null != executor) {
|
// this.executor.accept(channel, bytes);
|
||||||
this.executor.accept(channel, bytes);
|
// }
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.proxy.domain;
|
package org.dromara.neutrinoproxy.server.proxy.domain;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import io.netty.channel.socket.nio.NioServerSocketChannel;
|
|||||||
import io.netty.handler.logging.LoggingHandler;
|
import io.netty.handler.logging.LoggingHandler;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.dromara.neutrinoproxy.server.base.proxy.ProxyConfig;
|
import org.dromara.neutrinoproxy.server.base.proxy.ProxyConfig;
|
||||||
import org.dromara.neutrinoproxy.server.proxy.core.BytesMetricsHandler;
|
|
||||||
import org.dromara.neutrinoproxy.server.proxy.security.HttpVisitorSecurityChannelHandler;
|
import org.dromara.neutrinoproxy.server.proxy.security.HttpVisitorSecurityChannelHandler;
|
||||||
import org.dromara.neutrinoproxy.server.proxy.security.VisitorFlowLimiterChannelHandler;
|
import org.dromara.neutrinoproxy.server.proxy.security.VisitorFlowLimiterChannelHandler;
|
||||||
import org.noear.solon.annotation.Component;
|
import org.noear.solon.annotation.Component;
|
||||||
@@ -45,7 +44,7 @@ public class HttpProxy implements EventListener<AppLoadEndEvent> {
|
|||||||
if (null != proxyConfig.getServer().getTcp().getTransferLogEnable() && proxyConfig.getServer().getTcp().getTransferLogEnable()) {
|
if (null != proxyConfig.getServer().getTcp().getTransferLogEnable() && proxyConfig.getServer().getTcp().getTransferLogEnable()) {
|
||||||
ch.pipeline().addFirst(new LoggingHandler(HttpProxy.class));
|
ch.pipeline().addFirst(new LoggingHandler(HttpProxy.class));
|
||||||
}
|
}
|
||||||
ch.pipeline().addFirst(new BytesMetricsHandler());
|
// ch.pipeline().addFirst(new BytesMetricsHandler());
|
||||||
ch.pipeline().addLast(new HttpVisitorSecurityChannelHandler(false));
|
ch.pipeline().addLast(new HttpVisitorSecurityChannelHandler(false));
|
||||||
ch.pipeline().addLast("flowLimiter",new VisitorFlowLimiterChannelHandler());
|
ch.pipeline().addLast("flowLimiter",new VisitorFlowLimiterChannelHandler());
|
||||||
ch.pipeline().addLast(new HttpVisitorChannelHandler());
|
ch.pipeline().addLast(new HttpVisitorChannelHandler());
|
||||||
|
|||||||
@@ -1,22 +1,22 @@
|
|||||||
package org.dromara.neutrinoproxy.server.proxy.enhance;
|
package org.dromara.neutrinoproxy.server.proxy.enhance;
|
||||||
|
|
||||||
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBuf;
|
||||||
import io.netty.channel.Channel;
|
import io.netty.buffer.Unpooled;
|
||||||
import io.netty.channel.ChannelHandlerContext;
|
import io.netty.channel.*;
|
||||||
import io.netty.channel.ChannelOption;
|
import io.netty.handler.codec.DecoderException;
|
||||||
import io.netty.channel.SimpleChannelInboundHandler;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.dromara.neutrinoproxy.core.Constants;
|
import org.dromara.neutrinoproxy.core.Constants;
|
||||||
import org.dromara.neutrinoproxy.core.ProxyMessage;
|
import org.dromara.neutrinoproxy.core.ProxyMessage;
|
||||||
import org.dromara.neutrinoproxy.server.constant.NetworkProtocolEnum;
|
import org.dromara.neutrinoproxy.server.constant.NetworkProtocolEnum;
|
||||||
import org.dromara.neutrinoproxy.server.proxy.domain.ProxyAttachment;
|
|
||||||
import org.dromara.neutrinoproxy.server.proxy.domain.VisitorChannelAttachInfo;
|
import org.dromara.neutrinoproxy.server.proxy.domain.VisitorChannelAttachInfo;
|
||||||
import org.dromara.neutrinoproxy.server.service.FlowReportService;
|
import org.dromara.neutrinoproxy.server.service.FlowReportService;
|
||||||
import org.dromara.neutrinoproxy.server.util.ProxyUtil;
|
import org.dromara.neutrinoproxy.server.util.ProxyUtil;
|
||||||
import org.noear.solon.Solon;
|
import org.noear.solon.Solon;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
|
import java.net.SocketException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author: aoshiguchen
|
* @author: aoshiguchen
|
||||||
@@ -30,7 +30,7 @@ public class HttpVisitorChannelHandler extends SimpleChannelInboundHandler<ByteB
|
|||||||
byte[] bytes = new byte[byteBuf.readableBytes()];
|
byte[] bytes = new byte[byteBuf.readableBytes()];
|
||||||
byteBuf.readBytes(bytes);
|
byteBuf.readBytes(bytes);
|
||||||
byteBuf.resetReaderIndex();
|
byteBuf.resetReaderIndex();
|
||||||
ProxyAttachment proxyAttachment = new ProxyAttachment(ctx.channel(), bytes, (channel, buf) -> {
|
Constants.ProxyAttachment proxyAttachment = new Constants.ProxyAttachment(bytes, (channel, buf) -> {
|
||||||
Channel proxyChannel = channel.attr(Constants.NEXT_CHANNEL).get();
|
Channel proxyChannel = channel.attr(Constants.NEXT_CHANNEL).get();
|
||||||
if (null == proxyChannel) {
|
if (null == proxyChannel) {
|
||||||
// 该端口还没有代理客户端
|
// 该端口还没有代理客户端
|
||||||
@@ -47,7 +47,7 @@ public class HttpVisitorChannelHandler extends SimpleChannelInboundHandler<ByteB
|
|||||||
|
|
||||||
String visitorId = ProxyUtil.getVisitorIdByChannel(ctx.channel());
|
String visitorId = ProxyUtil.getVisitorIdByChannel(ctx.channel());
|
||||||
if (StringUtils.isNotBlank(visitorId)) {
|
if (StringUtils.isNotBlank(visitorId)) {
|
||||||
proxyAttachment.execute();
|
proxyAttachment.execute(ctx.channel());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -70,7 +70,8 @@ public class HttpVisitorChannelHandler extends SimpleChannelInboundHandler<ByteB
|
|||||||
|
|
||||||
visitorId = ProxyUtil.newVisitorId();
|
visitorId = ProxyUtil.newVisitorId();
|
||||||
ProxyUtil.addVisitorChannelToCmdChannel(NetworkProtocolEnum.HTTP, cmdChannel, visitorId, ctx.channel(), serverPort);
|
ProxyUtil.addVisitorChannelToCmdChannel(NetworkProtocolEnum.HTTP, cmdChannel, visitorId, ctx.channel(), serverPort);
|
||||||
ProxyUtil.addProxyConnectAttachment(visitorId, proxyAttachment);
|
// ProxyUtil.addProxyConnectAttachment(visitorId, proxyAttachment);
|
||||||
|
ctx.channel().attr(Constants.PROXY_CONNECT_ATTACHMENT).set(proxyAttachment);
|
||||||
cmdChannel.writeAndFlush(ProxyMessage.buildConnectMessage(visitorId).setData(lanInfo.getBytes()));
|
cmdChannel.writeAndFlush(ProxyMessage.buildConnectMessage(visitorId).setData(lanInfo.getBytes()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -82,11 +83,7 @@ public class HttpVisitorChannelHandler extends SimpleChannelInboundHandler<ByteB
|
|||||||
InetSocketAddress sa = (InetSocketAddress) visitorChannel.localAddress();
|
InetSocketAddress sa = (InetSocketAddress) visitorChannel.localAddress();
|
||||||
Channel cmdChannel = ProxyUtil.getCmdChannelByServerPort(sa.getPort());
|
Channel cmdChannel = ProxyUtil.getCmdChannelByServerPort(sa.getPort());
|
||||||
|
|
||||||
if (cmdChannel == null) {
|
if (null != cmdChannel) {
|
||||||
// 该端口还没有代理客户端
|
|
||||||
ctx.channel().close();
|
|
||||||
} else {
|
|
||||||
|
|
||||||
// 用户连接断开,从控制连接中移除
|
// 用户连接断开,从控制连接中移除
|
||||||
String visitorId = ProxyUtil.getVisitorIdByChannel(visitorChannel);
|
String visitorId = ProxyUtil.getVisitorIdByChannel(visitorChannel);
|
||||||
ProxyUtil.removeVisitorChannelFromCmdChannel(cmdChannel, visitorId);
|
ProxyUtil.removeVisitorChannelFromCmdChannel(cmdChannel, visitorId);
|
||||||
@@ -103,6 +100,8 @@ public class HttpVisitorChannelHandler extends SimpleChannelInboundHandler<ByteB
|
|||||||
proxyChannel.config().setOption(ChannelOption.AUTO_READ, true);
|
proxyChannel.config().setOption(ChannelOption.AUTO_READ, true);
|
||||||
// 通知客户端,用户连接已经断开
|
// 通知客户端,用户连接已经断开
|
||||||
proxyChannel.writeAndFlush(ProxyMessage.buildDisconnectMessage(visitorId));
|
proxyChannel.writeAndFlush(ProxyMessage.buildDisconnectMessage(visitorId));
|
||||||
|
|
||||||
|
proxyChannel.writeAndFlush(Unpooled.EMPTY_BUFFER).addListener(ChannelFutureListener.CLOSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -116,8 +115,29 @@ public class HttpVisitorChannelHandler extends SimpleChannelInboundHandler<ByteB
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
|
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
|
||||||
// 当出现异常就关闭连接
|
// 对于网络IO异常(致命异常),关闭channel以防止资源泄漏
|
||||||
ctx.close();
|
// 对于其他异常(可能是可恢复的业务异常),只记录日志
|
||||||
|
if (cause instanceof IOException) {
|
||||||
|
// IOException及其子类(包括SocketException)都是致命的网络异常
|
||||||
|
if (cause instanceof SocketException && cause.getMessage() != null && cause.getMessage().contains("Connection reset")) {
|
||||||
|
// Connection reset是常见的客户端断开,使用debug级别
|
||||||
|
log.debug("[HTTP Visitor Channel] Connection reset: {}", cause.getMessage());
|
||||||
|
} else {
|
||||||
|
log.error("[HTTP Visitor Channel] IO error", cause);
|
||||||
|
}
|
||||||
|
if (ctx.channel().isActive()) {
|
||||||
|
ctx.channel().close();
|
||||||
|
}
|
||||||
|
} else if(cause instanceof DecoderException) {
|
||||||
|
// 协议解析错误,为防止数据污染,立即关闭
|
||||||
|
log.debug("[HTTP Visitor Channel] decoder error: {}", cause.getMessage());
|
||||||
|
if (ctx.channel().isActive()) {
|
||||||
|
ctx.channel().close();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 其他异常只记录日志,不关闭channel,让Netty自己处理
|
||||||
|
log.error("[HTTP Visitor Channel] error", cause);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import io.netty.handler.ssl.SniHandler;
|
|||||||
import io.netty.handler.ssl.SslContext;
|
import io.netty.handler.ssl.SslContext;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.dromara.neutrinoproxy.server.base.proxy.ProxyConfig;
|
import org.dromara.neutrinoproxy.server.base.proxy.ProxyConfig;
|
||||||
import org.dromara.neutrinoproxy.server.proxy.core.BytesMetricsHandler;
|
|
||||||
import org.dromara.neutrinoproxy.server.proxy.security.HttpVisitorSecurityChannelHandler;
|
import org.dromara.neutrinoproxy.server.proxy.security.HttpVisitorSecurityChannelHandler;
|
||||||
import org.dromara.neutrinoproxy.server.proxy.security.VisitorFlowLimiterChannelHandler;
|
import org.dromara.neutrinoproxy.server.proxy.security.VisitorFlowLimiterChannelHandler;
|
||||||
import org.noear.solon.annotation.Component;
|
import org.noear.solon.annotation.Component;
|
||||||
@@ -51,7 +50,7 @@ public class HttpsProxy implements EventListener<AppLoadEndEvent> {
|
|||||||
ch.pipeline().addFirst(new LoggingHandler(HttpsProxy.class));
|
ch.pipeline().addFirst(new LoggingHandler(HttpsProxy.class));
|
||||||
}
|
}
|
||||||
ch.pipeline().addLast(createSniHandler());
|
ch.pipeline().addLast(createSniHandler());
|
||||||
ch.pipeline().addFirst(new BytesMetricsHandler());
|
// ch.pipeline().addFirst(new BytesMetricsHandler());
|
||||||
ch.pipeline().addLast(new HttpVisitorSecurityChannelHandler(true));
|
ch.pipeline().addLast(new HttpVisitorSecurityChannelHandler(true));
|
||||||
ch.pipeline().addLast("flowLimiter",new VisitorFlowLimiterChannelHandler());
|
ch.pipeline().addLast("flowLimiter",new VisitorFlowLimiterChannelHandler());
|
||||||
ch.pipeline().addLast(new HttpVisitorChannelHandler());
|
ch.pipeline().addLast(new HttpVisitorChannelHandler());
|
||||||
|
|||||||
@@ -1,25 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.dromara.neutrinoproxy.server.proxy.handler;
|
package org.dromara.neutrinoproxy.server.proxy.handler;
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import org.dromara.neutrinoproxy.core.dispatcher.Match;
|
|||||||
import org.dromara.neutrinoproxy.server.constant.EnableStatusEnum;
|
import org.dromara.neutrinoproxy.server.constant.EnableStatusEnum;
|
||||||
import org.dromara.neutrinoproxy.server.dal.entity.LicenseDO;
|
import org.dromara.neutrinoproxy.server.dal.entity.LicenseDO;
|
||||||
import org.dromara.neutrinoproxy.server.dal.entity.UserDO;
|
import org.dromara.neutrinoproxy.server.dal.entity.UserDO;
|
||||||
import org.dromara.neutrinoproxy.server.proxy.domain.ProxyAttachment;
|
|
||||||
import org.dromara.neutrinoproxy.server.service.LicenseService;
|
import org.dromara.neutrinoproxy.server.service.LicenseService;
|
||||||
import org.dromara.neutrinoproxy.server.service.UserService;
|
import org.dromara.neutrinoproxy.server.service.UserService;
|
||||||
import org.dromara.neutrinoproxy.server.util.ProxyUtil;
|
import org.dromara.neutrinoproxy.server.util.ProxyUtil;
|
||||||
@@ -76,8 +75,11 @@ public class ProxyMessageConnectHandler implements ProxyMessageHandler {
|
|||||||
|
|
||||||
Channel visitorChannel = ProxyUtil.getVisitorChannel(cmdChannel, visitorId);
|
Channel visitorChannel = ProxyUtil.getVisitorChannel(cmdChannel, visitorId);
|
||||||
if (null == visitorChannel) {
|
if (null == visitorChannel) {
|
||||||
|
ctx.channel().writeAndFlush(ProxyMessage.buildErrMessage(ExceptionEnum.CONNECT_FAILED, "server error,visitor channel not found!"));
|
||||||
|
ctx.channel().close();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx.channel().attr(Constants.VISITOR_ID).set(visitorId);
|
ctx.channel().attr(Constants.VISITOR_ID).set(visitorId);
|
||||||
ctx.channel().attr(Constants.LICENSE_ID).set(licenseDO.getId());
|
ctx.channel().attr(Constants.LICENSE_ID).set(licenseDO.getId());
|
||||||
ctx.channel().attr(Constants.NEXT_CHANNEL).set(visitorChannel);
|
ctx.channel().attr(Constants.NEXT_CHANNEL).set(visitorChannel);
|
||||||
@@ -86,13 +88,24 @@ public class ProxyMessageConnectHandler implements ProxyMessageHandler {
|
|||||||
// 代理客户端与后端服务器连接成功,修改用户连接为可读状态
|
// 代理客户端与后端服务器连接成功,修改用户连接为可读状态
|
||||||
visitorChannel.config().setOption(ChannelOption.AUTO_READ, true);
|
visitorChannel.config().setOption(ChannelOption.AUTO_READ, true);
|
||||||
|
|
||||||
// 获取代理附加对象
|
|
||||||
ProxyAttachment proxyAttachment = ProxyUtil.getProxyConnectAttachment(visitorId);
|
// 获取代理附加对象
|
||||||
if (null != proxyAttachment) {
|
Constants.ProxyAttachment proxyAttachment = visitorChannel.attr(Constants.PROXY_CONNECT_ATTACHMENT).get();
|
||||||
// 及时释放
|
if (null != proxyAttachment) {
|
||||||
ProxyUtil.remoteProxyConnectAttachment(visitorId);
|
// 转发来自visitor的首次代理数据
|
||||||
proxyAttachment.execute();
|
proxyAttachment.execute(visitorChannel);
|
||||||
}
|
|
||||||
|
// 此处时TCP代理,不一定有代理附加对象,不能因为没有而直接释放visitorChannel
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// // 获取代理附加对象
|
||||||
|
// ProxyAttachment proxyAttachment = ProxyUtil.getProxyConnectAttachment(visitorId);
|
||||||
|
// if (null != proxyAttachment) {
|
||||||
|
// // 及时释放
|
||||||
|
// ProxyUtil.remoteProxyConnectAttachment(visitorId);
|
||||||
|
// proxyAttachment.execute();
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -38,6 +38,8 @@ public class ProxyMessageTransferHandler implements ProxyMessageHandler {
|
|||||||
ctx.channel().config().setAutoRead(true);
|
ctx.channel().config().setAutoRead(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// TODO Netty默认的高水位通常只有64KB,在SCP/SFTP场景下可能很快就填满了。
|
||||||
|
// 而visitorChannel.writeAndFlush(buf);是异步的。有可能写入数据极快,而visitorChannel的isWritable还没来得及变成false,此处就会写入大量数据把缓冲撑爆。
|
||||||
ByteBuf buf = ctx.alloc().buffer(proxyMessage.getData().length);
|
ByteBuf buf = ctx.alloc().buffer(proxyMessage.getData().length);
|
||||||
buf.writeBytes(proxyMessage.getData());
|
buf.writeBytes(proxyMessage.getData());
|
||||||
visitorChannel.writeAndFlush(buf);
|
visitorChannel.writeAndFlush(buf);
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ import org.dromara.neutrinoproxy.server.dal.PortMappingMapper;
|
|||||||
import org.dromara.neutrinoproxy.server.dal.entity.LicenseDO;
|
import org.dromara.neutrinoproxy.server.dal.entity.LicenseDO;
|
||||||
import org.dromara.neutrinoproxy.server.dal.entity.PortMappingDO;
|
import org.dromara.neutrinoproxy.server.dal.entity.PortMappingDO;
|
||||||
import org.dromara.neutrinoproxy.server.dal.entity.UserDO;
|
import org.dromara.neutrinoproxy.server.dal.entity.UserDO;
|
||||||
import org.dromara.neutrinoproxy.server.proxy.domain.ProxyAttachment;
|
|
||||||
import org.dromara.neutrinoproxy.server.service.LicenseService;
|
import org.dromara.neutrinoproxy.server.service.LicenseService;
|
||||||
import org.dromara.neutrinoproxy.server.service.UserService;
|
import org.dromara.neutrinoproxy.server.service.UserService;
|
||||||
import org.dromara.neutrinoproxy.server.util.ProxyUtil;
|
import org.dromara.neutrinoproxy.server.util.ProxyUtil;
|
||||||
@@ -87,16 +86,18 @@ public class UdpProxyMessageConnectHandler implements ProxyMessageHandler {
|
|||||||
ctx.channel().attr(Constants.TARGET_PORT).set(portMappingDO.getClientPort());
|
ctx.channel().attr(Constants.TARGET_PORT).set(portMappingDO.getClientPort());
|
||||||
ctx.channel().attr(Constants.PROXY_RESPONSES).set(portMappingDO.getProxyResponses());
|
ctx.channel().attr(Constants.PROXY_RESPONSES).set(portMappingDO.getProxyResponses());
|
||||||
ctx.channel().attr(Constants.PROXY_TIMEOUT_MS).set(portMappingDO.getProxyTimeoutMs());
|
ctx.channel().attr(Constants.PROXY_TIMEOUT_MS).set(portMappingDO.getProxyTimeoutMs());
|
||||||
visitorChannel.attr(Constants.NEXT_CHANNEL).set(ctx.channel());
|
// 所有udb visitor共用一个visitorChannel,设置这个没啥用
|
||||||
|
// visitorChannel.attr(Constants.NEXT_CHANNEL).set(ctx.channel());
|
||||||
|
ProxyUtil.setVisitorIdToTunnelChannelMap(udpBaseInfo.getVisitorId(), ctx.channel());
|
||||||
visitorChannel.attr(Constants.IS_UDP_KEY).set(Boolean.TRUE);
|
visitorChannel.attr(Constants.IS_UDP_KEY).set(Boolean.TRUE);
|
||||||
// // 代理客户端与后端服务器连接成功,修改用户连接为可读状态
|
// // 代理客户端与后端服务器连接成功,修改用户连接为可读状态
|
||||||
// visitorChannel.config().setOption(ChannelOption.AUTO_READ, true);
|
// visitorChannel.config().setOption(ChannelOption.AUTO_READ, true);
|
||||||
// 获取代理附加对象
|
// 获取代理附加对象
|
||||||
ProxyAttachment proxyAttachment = ProxyUtil.getProxyConnectAttachment(udpBaseInfo.getVisitorId());
|
Constants.ProxyAttachment proxyAttachment = ProxyUtil.getProxyConnectAttachment(udpBaseInfo.getVisitorId());
|
||||||
if (null != proxyAttachment) {
|
if (null != proxyAttachment) {
|
||||||
// 及时释放
|
// 及时释放
|
||||||
ProxyUtil.remoteProxyConnectAttachment(udpBaseInfo.getVisitorId());
|
ProxyUtil.remoteProxyConnectAttachment(udpBaseInfo.getVisitorId());
|
||||||
proxyAttachment.execute();
|
proxyAttachment.execute(visitorChannel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,33 +31,31 @@ public class UdpProxyMessageTransferHandler implements ProxyMessageHandler {
|
|||||||
log.debug("[UDP transfer]info:{} data:{}", proxyMessage.getInfo(), new String(proxyMessage.getData()));
|
log.debug("[UDP transfer]info:{} data:{}", proxyMessage.getInfo(), new String(proxyMessage.getData()));
|
||||||
|
|
||||||
Channel visitorChannel = ctx.channel().attr(Constants.NEXT_CHANNEL).get();
|
Channel visitorChannel = ctx.channel().attr(Constants.NEXT_CHANNEL).get();
|
||||||
if (null != visitorChannel) {
|
if (null == visitorChannel) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!visitorChannel.isWritable()) {
|
if (!visitorChannel.isWritable()) {
|
||||||
//自己不可写,通道可以读,让通道关闭读
|
//自己不可写,通道可以读,让通道关闭读
|
||||||
//自己可写,通道不可以读,让通道打开读
|
//自己可写,通道不可以读,让通道打开读
|
||||||
if (ctx.channel().config().isAutoRead()) {
|
if (ctx.channel().config().isAutoRead()) {
|
||||||
ctx.channel().config().setAutoRead(false);
|
ctx.channel().config().setAutoRead(false);
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (ctx.channel().config().isAutoRead()) {
|
|
||||||
ctx.channel().config().setAutoRead(true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if (ctx.channel().config().isAutoRead()) {
|
||||||
|
ctx.channel().config().setAutoRead(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// InetSocketAddress address = new InetSocketAddress(udpBaseInfo.getVisitorIp(), udpBaseInfo.getVisitorPort());
|
InetSocketAddress address = ctx.channel().attr(Constants.SENDER).get();
|
||||||
// ByteBuf byteBuf = Unpooled.copiedBuffer(proxyMessage.getData());
|
if (null != address) {
|
||||||
// visitorChannel.writeAndFlush(new DatagramPacket(byteBuf, address));
|
visitorChannel.writeAndFlush(new DatagramPacket(Unpooled.copiedBuffer(proxyMessage.getData()), address));
|
||||||
InetSocketAddress address = ctx.channel().attr(Constants.SENDER).get();
|
}
|
||||||
if (null != address) {
|
|
||||||
visitorChannel.writeAndFlush(new DatagramPacket(Unpooled.copiedBuffer(proxyMessage.getData()), address));
|
|
||||||
}
|
|
||||||
|
|
||||||
// 增加流量计数(TODO 如果UDP映射服务端端口修改,这个似乎不准)
|
// 增加流量计数(TODO 如果UDP映射服务端端口修改,这个似乎不准)
|
||||||
Integer licenseId = visitorChannel.attr(Constants.LICENSE_ID).get();
|
Integer licenseId = visitorChannel.attr(Constants.LICENSE_ID).get();
|
||||||
if (null != licenseId) {
|
if (null != licenseId) {
|
||||||
Solon.context().getBean(FlowReportService.class).addReadByte(licenseId, proxyMessage.getData().length);
|
Solon.context().getBean(FlowReportService.class).addReadByte(licenseId, proxyMessage.getData().length);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,15 @@
|
|||||||
package org.dromara.neutrinoproxy.server.proxy.security;
|
package org.dromara.neutrinoproxy.server.proxy.security;
|
||||||
|
|
||||||
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBuf;
|
||||||
import io.netty.channel.ChannelHandlerContext;
|
import io.netty.buffer.Unpooled;
|
||||||
import io.netty.channel.ChannelInboundHandlerAdapter;
|
import io.netty.channel.*;
|
||||||
|
import io.netty.handler.codec.DecoderException;
|
||||||
|
import io.netty.util.CharsetUtil;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.checkerframework.checker.i18nformatter.qual.I18nFormat;
|
||||||
import org.dromara.neutrinoproxy.core.Constants;
|
import org.dromara.neutrinoproxy.core.Constants;
|
||||||
|
import org.dromara.neutrinoproxy.core.ProxyMessage;
|
||||||
import org.dromara.neutrinoproxy.core.util.HttpUtil;
|
import org.dromara.neutrinoproxy.core.util.HttpUtil;
|
||||||
import org.dromara.neutrinoproxy.core.util.IpUtil;
|
import org.dromara.neutrinoproxy.core.util.IpUtil;
|
||||||
import org.dromara.neutrinoproxy.server.service.DomainService;
|
import org.dromara.neutrinoproxy.server.service.DomainService;
|
||||||
@@ -14,6 +18,10 @@ import org.dromara.neutrinoproxy.server.service.SecurityGroupService;
|
|||||||
import org.dromara.neutrinoproxy.server.util.ProxyUtil;
|
import org.dromara.neutrinoproxy.server.util.ProxyUtil;
|
||||||
import org.noear.solon.Solon;
|
import org.noear.solon.Solon;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.net.InetSocketAddress;
|
||||||
|
import java.net.SocketException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author: aoshiguchen
|
* @author: aoshiguchen
|
||||||
* @date: 2023/12/14
|
* @date: 2023/12/14
|
||||||
@@ -28,18 +36,35 @@ public class HttpVisitorSecurityChannelHandler extends ChannelInboundHandlerAdap
|
|||||||
*/
|
*/
|
||||||
private Boolean isHttps;
|
private Boolean isHttps;
|
||||||
|
|
||||||
|
// 拼接收到的 ByteBuf 内容
|
||||||
|
private ByteBuf cumulationBuf = Unpooled.buffer();
|
||||||
|
// private boolean initialized = false;
|
||||||
|
|
||||||
public HttpVisitorSecurityChannelHandler(Boolean isHttps) {
|
public HttpVisitorSecurityChannelHandler(Boolean isHttps) {
|
||||||
this.isHttps = isHttps;
|
this.isHttps = isHttps;
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
|
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
|
||||||
|
// if (initialized) {
|
||||||
|
// // 已经初始化,直接透传
|
||||||
|
// ctx.fireChannelRead(msg);
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// 累加数据包
|
||||||
ByteBuf buf = (ByteBuf) msg;
|
ByteBuf buf = (ByteBuf) msg;
|
||||||
|
cumulationBuf.writeBytes(buf);
|
||||||
|
|
||||||
|
String dataStr = cumulationBuf.toString(CharsetUtil.UTF_8);
|
||||||
|
int headerEndIndex = dataStr.indexOf("\r\n\r\n");
|
||||||
|
if (-1 == headerEndIndex) {
|
||||||
|
// 请求头还没读完,继续等
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// 获取Host请求头
|
// 获取Host请求头
|
||||||
byte[] bytes = new byte[buf.readableBytes()];
|
String headerPart = dataStr.substring(0, headerEndIndex + 4);
|
||||||
buf.readBytes(bytes);
|
String host = HttpUtil.getHostIgnorePort(headerPart); //test1.asgc.fun
|
||||||
String httpContent = new String(bytes);
|
|
||||||
String host = HttpUtil.getHostIgnorePort(httpContent); //test1.asgc.fun
|
|
||||||
|
|
||||||
log.debug("HttpProxy host: {}", host);
|
log.debug("HttpProxy host: {}", host);
|
||||||
if (StringUtils.isBlank(host)) {
|
if (StringUtils.isBlank(host)) {
|
||||||
@@ -68,7 +93,7 @@ public class HttpVisitorSecurityChannelHandler extends ChannelInboundHandlerAdap
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 判断IP是否在该端口绑定的安全组允许的规则内
|
// 判断IP是否在该端口绑定的安全组允许的规则内
|
||||||
String ip = IpUtil.getRealRemoteIp(httpContent);
|
String ip = IpUtil.getRealRemoteIp(headerPart);
|
||||||
if (ip == null) {
|
if (ip == null) {
|
||||||
ip = IpUtil.getRemoteIp(ctx);
|
ip = IpUtil.getRemoteIp(ctx);
|
||||||
}
|
}
|
||||||
@@ -82,9 +107,71 @@ public class HttpVisitorSecurityChannelHandler extends ChannelInboundHandlerAdap
|
|||||||
ctx.channel().attr(Constants.SERVER_PORT).set(serverPort);
|
ctx.channel().attr(Constants.SERVER_PORT).set(serverPort);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 从此之后所有的 in 都是“直接透传”。
|
||||||
|
// 否则,若请求体过长,数据包被拆分为多个,后续的数据包都无法解析出host,导致转发数据不完整。
|
||||||
|
ctx.pipeline().remove(this);
|
||||||
|
|
||||||
// 继续传播
|
// 继续传播
|
||||||
buf.resetReaderIndex();
|
ctx.fireChannelRead(cumulationBuf);
|
||||||
ctx.fireChannelRead(buf);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
|
||||||
|
// 对于网络IO异常(致命异常),关闭channel以防止资源泄漏
|
||||||
|
// 对于其他异常(可能是可恢复的业务异常),只记录日志
|
||||||
|
if (cause instanceof IOException) {
|
||||||
|
// IOException及其子类(包括SocketException)都是致命的网络异常
|
||||||
|
if (cause instanceof SocketException && cause.getMessage() != null && cause.getMessage().contains("Connection reset")) {
|
||||||
|
// Connection reset是常见的客户端断开,使用debug级别
|
||||||
|
log.debug("[HTTP Visitor Security Channel] Connection reset: {}", cause.getMessage());
|
||||||
|
} else {
|
||||||
|
log.error("[HTTP Visitor Security Channel] IO error", cause);
|
||||||
|
}
|
||||||
|
if (ctx.channel().isActive()) {
|
||||||
|
ctx.channel().close();
|
||||||
|
}
|
||||||
|
} else if(cause instanceof DecoderException) {
|
||||||
|
// 协议解析错误,为防止数据污染,立即关闭
|
||||||
|
log.debug("[HTTP Visitor Security Channel] decoder error: {}", cause.getMessage());
|
||||||
|
if (ctx.channel().isActive()) {
|
||||||
|
ctx.channel().close();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 其他异常只记录日志,不关闭channel,让Netty自己处理
|
||||||
|
log.error("[HTTP Visitor Security Channel] error", cause);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
|
||||||
|
|
||||||
|
// 通知代理客户端
|
||||||
|
Channel visitorChannel = ctx.channel();
|
||||||
|
InetSocketAddress sa = (InetSocketAddress) visitorChannel.localAddress();
|
||||||
|
Channel cmdChannel = ProxyUtil.getCmdChannelByServerPort(sa.getPort());
|
||||||
|
|
||||||
|
if (null != cmdChannel) {
|
||||||
|
// 用户连接断开,从控制连接中移除
|
||||||
|
String visitorId = ProxyUtil.getVisitorIdByChannel(visitorChannel);
|
||||||
|
ProxyUtil.removeVisitorChannelFromCmdChannel(cmdChannel, visitorId);
|
||||||
|
|
||||||
|
// 删除代理附加对象
|
||||||
|
ProxyUtil.remoteProxyConnectAttachment(visitorId);
|
||||||
|
|
||||||
|
Channel proxyChannel = visitorChannel.attr(Constants.NEXT_CHANNEL).get();
|
||||||
|
if (proxyChannel != null && proxyChannel.isActive()) {
|
||||||
|
proxyChannel.attr(Constants.NEXT_CHANNEL).remove();
|
||||||
|
proxyChannel.attr(Constants.LICENSE_ID).remove();
|
||||||
|
proxyChannel.attr(Constants.VISITOR_ID).remove();
|
||||||
|
|
||||||
|
proxyChannel.config().setOption(ChannelOption.AUTO_READ, true);
|
||||||
|
// 通知客户端,用户连接已经断开
|
||||||
|
proxyChannel.writeAndFlush(ProxyMessage.buildDisconnectMessage(visitorId));
|
||||||
|
|
||||||
|
proxyChannel.writeAndFlush(Unpooled.EMPTY_BUFFER).addListener(ChannelFutureListener.CLOSE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
super.channelInactive(ctx);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,18 +1,22 @@
|
|||||||
package org.dromara.neutrinoproxy.server.proxy.security;
|
package org.dromara.neutrinoproxy.server.proxy.security;
|
||||||
|
|
||||||
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBuf;
|
||||||
import io.netty.channel.Channel;
|
import io.netty.buffer.Unpooled;
|
||||||
import io.netty.channel.ChannelHandlerContext;
|
import io.netty.channel.*;
|
||||||
import io.netty.channel.ChannelInboundHandlerAdapter;
|
import io.netty.handler.codec.DecoderException;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.dromara.neutrinoproxy.core.Constants;
|
import org.dromara.neutrinoproxy.core.Constants;
|
||||||
|
import org.dromara.neutrinoproxy.core.ProxyMessage;
|
||||||
import org.dromara.neutrinoproxy.core.util.IpUtil;
|
import org.dromara.neutrinoproxy.core.util.IpUtil;
|
||||||
import org.dromara.neutrinoproxy.server.service.PortMappingService;
|
import org.dromara.neutrinoproxy.server.service.PortMappingService;
|
||||||
import org.dromara.neutrinoproxy.server.service.SecurityGroupService;
|
import org.dromara.neutrinoproxy.server.service.SecurityGroupService;
|
||||||
|
import org.dromara.neutrinoproxy.server.util.ProxyUtil;
|
||||||
import org.noear.solon.Solon;
|
import org.noear.solon.Solon;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
|
import java.net.SocketException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author: aoshiguchen
|
* @author: aoshiguchen
|
||||||
@@ -65,4 +69,64 @@ public class TcpVisitorSecurityChannelHandler extends ChannelInboundHandlerAdapt
|
|||||||
ctx.fireChannelActive();
|
ctx.fireChannelActive();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
|
||||||
|
// 对于网络IO异常(致命异常),关闭channel以防止资源泄漏
|
||||||
|
// 对于其他异常(可能是可恢复的业务异常),只记录日志
|
||||||
|
if (cause instanceof IOException) {
|
||||||
|
// IOException及其子类(包括SocketException)都是致命的网络异常
|
||||||
|
if (cause instanceof SocketException && cause.getMessage() != null && cause.getMessage().contains("Connection reset")) {
|
||||||
|
// Connection reset是常见的客户端断开,使用debug级别
|
||||||
|
log.debug("[TCP Visitor Security Channel] Connection reset: {}", cause.getMessage());
|
||||||
|
} else {
|
||||||
|
log.error("[TCP Visitor Security Channel] IO error", cause);
|
||||||
|
}
|
||||||
|
if (ctx.channel().isActive()) {
|
||||||
|
ctx.channel().close();
|
||||||
|
}
|
||||||
|
} else if(cause instanceof DecoderException) {
|
||||||
|
// 协议解析错误,为防止数据污染,立即关闭
|
||||||
|
log.debug("[TCP Visitor Security Channel] decoder error: {}", cause.getMessage());
|
||||||
|
if (ctx.channel().isActive()) {
|
||||||
|
ctx.channel().close();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 其他异常只记录日志,不关闭channel,让Netty自己处理
|
||||||
|
log.error("[TCP Visitor Security Channel] error", cause);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
|
||||||
|
|
||||||
|
// 通知代理客户端
|
||||||
|
Channel visitorChannel = ctx.channel();
|
||||||
|
InetSocketAddress sa = (InetSocketAddress) visitorChannel.localAddress();
|
||||||
|
Channel cmdChannel = ProxyUtil.getCmdChannelByServerPort(sa.getPort());
|
||||||
|
|
||||||
|
if (null != cmdChannel) {
|
||||||
|
// 用户连接断开,从控制连接中移除
|
||||||
|
String visitorId = ProxyUtil.getVisitorIdByChannel(visitorChannel);
|
||||||
|
ProxyUtil.removeVisitorChannelFromCmdChannel(cmdChannel, visitorId);
|
||||||
|
|
||||||
|
// 删除代理附加对象
|
||||||
|
ProxyUtil.remoteProxyConnectAttachment(visitorId);
|
||||||
|
|
||||||
|
Channel proxyChannel = visitorChannel.attr(Constants.NEXT_CHANNEL).get();
|
||||||
|
if (proxyChannel != null && proxyChannel.isActive()) {
|
||||||
|
proxyChannel.attr(Constants.NEXT_CHANNEL).remove();
|
||||||
|
proxyChannel.attr(Constants.LICENSE_ID).remove();
|
||||||
|
proxyChannel.attr(Constants.VISITOR_ID).remove();
|
||||||
|
|
||||||
|
proxyChannel.config().setOption(ChannelOption.AUTO_READ, true);
|
||||||
|
// 通知客户端,用户连接已经断开
|
||||||
|
proxyChannel.writeAndFlush(ProxyMessage.buildDisconnectMessage(visitorId));
|
||||||
|
|
||||||
|
proxyChannel.writeAndFlush(Unpooled.EMPTY_BUFFER).addListener(ChannelFutureListener.CLOSE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
super.channelInactive(ctx);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,20 @@
|
|||||||
package org.dromara.neutrinoproxy.server.proxy.security;
|
package org.dromara.neutrinoproxy.server.proxy.security;
|
||||||
|
|
||||||
import io.netty.channel.Channel;
|
import io.netty.buffer.Unpooled;
|
||||||
import io.netty.channel.ChannelHandlerContext;
|
import io.netty.channel.*;
|
||||||
import io.netty.channel.ChannelInboundHandlerAdapter;
|
|
||||||
import io.netty.channel.socket.DatagramPacket;
|
import io.netty.channel.socket.DatagramPacket;
|
||||||
|
import io.netty.handler.codec.DecoderException;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.dromara.neutrinoproxy.core.Constants;
|
import org.dromara.neutrinoproxy.core.Constants;
|
||||||
|
import org.dromara.neutrinoproxy.core.ProxyMessage;
|
||||||
import org.dromara.neutrinoproxy.server.service.PortMappingService;
|
import org.dromara.neutrinoproxy.server.service.PortMappingService;
|
||||||
import org.dromara.neutrinoproxy.server.service.SecurityGroupService;
|
import org.dromara.neutrinoproxy.server.service.SecurityGroupService;
|
||||||
|
import org.dromara.neutrinoproxy.server.util.ProxyUtil;
|
||||||
import org.noear.solon.Solon;
|
import org.noear.solon.Solon;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
|
import java.net.SocketException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author: aoshiguchen
|
* @author: aoshiguchen
|
||||||
@@ -36,4 +40,64 @@ public class UdpVisitorSecurityChannelHandler extends ChannelInboundHandlerAdapt
|
|||||||
ctx.channel().attr(Constants.SERVER_PORT).set(sa.getPort());
|
ctx.channel().attr(Constants.SERVER_PORT).set(sa.getPort());
|
||||||
ctx.fireChannelRead(msg);
|
ctx.fireChannelRead(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @Override
|
||||||
|
// public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
|
||||||
|
// // 对于网络IO异常(致命异常),关闭channel以防止资源泄漏
|
||||||
|
// // 对于其他异常(可能是可恢复的业务异常),只记录日志
|
||||||
|
// if (cause instanceof IOException) {
|
||||||
|
// // IOException及其子类(包括SocketException)都是致命的网络异常
|
||||||
|
// if (cause instanceof SocketException && cause.getMessage() != null && cause.getMessage().contains("Connection reset")) {
|
||||||
|
// // Connection reset是常见的客户端断开,使用debug级别
|
||||||
|
// log.debug("[UDP Visitor Security Channel] Connection reset: {}", cause.getMessage());
|
||||||
|
// } else {
|
||||||
|
// log.error("[UDP Visitor Security Channel] IO error", cause);
|
||||||
|
// }
|
||||||
|
// if (ctx.channel().isActive()) {
|
||||||
|
// ctx.channel().close();
|
||||||
|
// }
|
||||||
|
// } else if(cause instanceof DecoderException) {
|
||||||
|
// // 协议解析错误,为防止数据污染,立即关闭
|
||||||
|
// log.debug("[UDP Visitor Security Channel] decoder error: {}", cause.getMessage());
|
||||||
|
// if (ctx.channel().isActive()) {
|
||||||
|
// ctx.channel().close();
|
||||||
|
// }
|
||||||
|
// } else {
|
||||||
|
// // 其他异常只记录日志,不关闭channel,让Netty自己处理
|
||||||
|
// log.error("[UDP Visitor Security Channel] error", cause);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// @Override
|
||||||
|
// public void channelInactive(ChannelHandlerContext ctx) throws Exception {
|
||||||
|
//
|
||||||
|
// // 通知代理客户端
|
||||||
|
// Channel visitorChannel = ctx.channel();
|
||||||
|
// InetSocketAddress sa = (InetSocketAddress) visitorChannel.localAddress();
|
||||||
|
// Channel cmdChannel = ProxyUtil.getCmdChannelByServerPort(sa.getPort());
|
||||||
|
//
|
||||||
|
// if (null != cmdChannel) {
|
||||||
|
// // 用户连接断开,从控制连接中移除
|
||||||
|
// String visitorId = ProxyUtil.getVisitorIdByChannel(visitorChannel);
|
||||||
|
// ProxyUtil.removeVisitorChannelFromCmdChannel(cmdChannel, visitorId);
|
||||||
|
//
|
||||||
|
// // 删除代理附加对象
|
||||||
|
// ProxyUtil.remoteProxyConnectAttachment(visitorId);
|
||||||
|
//
|
||||||
|
// Channel proxyChannel = visitorChannel.attr(Constants.NEXT_CHANNEL).get();
|
||||||
|
// if (proxyChannel != null && proxyChannel.isActive()) {
|
||||||
|
// proxyChannel.attr(Constants.NEXT_CHANNEL).remove();
|
||||||
|
// proxyChannel.attr(Constants.LICENSE_ID).remove();
|
||||||
|
// proxyChannel.attr(Constants.VISITOR_ID).remove();
|
||||||
|
//
|
||||||
|
// proxyChannel.config().setOption(ChannelOption.AUTO_READ, true);
|
||||||
|
// // 通知客户端,用户连接已经断开
|
||||||
|
// proxyChannel.writeAndFlush(ProxyMessage.buildDisconnectMessage(visitorId));
|
||||||
|
//
|
||||||
|
// proxyChannel.writeAndFlush(Unpooled.EMPTY_BUFFER).addListener(ChannelFutureListener.CLOSE);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// super.channelInactive(ctx);
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,14 @@
|
|||||||
package org.dromara.neutrinoproxy.server.proxy.security;
|
package org.dromara.neutrinoproxy.server.proxy.security;
|
||||||
|
|
||||||
import io.netty.channel.ChannelHandlerContext;
|
import io.netty.channel.*;
|
||||||
import io.netty.channel.ChannelInboundHandlerAdapter;
|
|
||||||
import io.netty.handler.traffic.ChannelTrafficShapingHandler;
|
import io.netty.handler.traffic.ChannelTrafficShapingHandler;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.dromara.neutrinoproxy.core.Constants;
|
import org.dromara.neutrinoproxy.core.Constants;
|
||||||
import org.dromara.neutrinoproxy.server.service.LicenseService;
|
|
||||||
import org.dromara.neutrinoproxy.server.service.PortMappingService;
|
import org.dromara.neutrinoproxy.server.service.PortMappingService;
|
||||||
import org.dromara.neutrinoproxy.server.service.SecurityGroupService;
|
|
||||||
import org.dromara.neutrinoproxy.server.service.bo.FlowLimitBO;
|
import org.dromara.neutrinoproxy.server.service.bo.FlowLimitBO;
|
||||||
import org.noear.solon.Solon;
|
import org.noear.solon.Solon;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 访问者流量限制器
|
* 访问者流量限制器
|
||||||
* @author: aoshiguchen
|
* @author: aoshiguchen
|
||||||
@@ -47,4 +45,63 @@ public class VisitorFlowLimiterChannelHandler extends ChannelInboundHandlerAdapt
|
|||||||
ctx.fireChannelRead(msg);
|
ctx.fireChannelRead(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @Override
|
||||||
|
// public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
|
||||||
|
// // 对于网络IO异常(致命异常),关闭channel以防止资源泄漏
|
||||||
|
// // 对于其他异常(可能是可恢复的业务异常),只记录日志
|
||||||
|
// if (cause instanceof IOException) {
|
||||||
|
// // IOException及其子类(包括SocketException)都是致命的网络异常
|
||||||
|
// if (cause instanceof SocketException && cause.getMessage() != null && cause.getMessage().contains("Connection reset")) {
|
||||||
|
// // Connection reset是常见的客户端断开,使用debug级别
|
||||||
|
// log.debug("[Visitor FlowLimit Channel] Connection reset: {}", cause.getMessage());
|
||||||
|
// } else {
|
||||||
|
// log.error("[Visitor FlowLimit Channel] IO error", cause);
|
||||||
|
// }
|
||||||
|
// if (ctx.channel().isActive()) {
|
||||||
|
// ctx.channel().close();
|
||||||
|
// }
|
||||||
|
// } else if(cause instanceof DecoderException) {
|
||||||
|
// // 协议解析错误,为防止数据污染,立即关闭
|
||||||
|
// log.debug("[Visitor FlowLimit Channel] decoder error: {}", cause.getMessage());
|
||||||
|
// if (ctx.channel().isActive()) {
|
||||||
|
// ctx.channel().close();
|
||||||
|
// }
|
||||||
|
// } else {
|
||||||
|
// // 其他异常只记录日志,不关闭channel,让Netty自己处理
|
||||||
|
// log.error("[Visitor FlowLimit Channel] error", cause);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// @Override
|
||||||
|
// public void channelInactive(ChannelHandlerContext ctx) throws Exception {
|
||||||
|
//
|
||||||
|
// // 通知代理客户端
|
||||||
|
// Channel visitorChannel = ctx.channel();
|
||||||
|
// InetSocketAddress sa = (InetSocketAddress) visitorChannel.localAddress();
|
||||||
|
// Channel cmdChannel = ProxyUtil.getCmdChannelByServerPort(sa.getPort());
|
||||||
|
//
|
||||||
|
// if (null != cmdChannel) {
|
||||||
|
// // 用户连接断开,从控制连接中移除
|
||||||
|
// String visitorId = ProxyUtil.getVisitorIdByChannel(visitorChannel);
|
||||||
|
// ProxyUtil.removeVisitorChannelFromCmdChannel(cmdChannel, visitorId);
|
||||||
|
//
|
||||||
|
// // 删除代理附加对象
|
||||||
|
// ProxyUtil.remoteProxyConnectAttachment(visitorId);
|
||||||
|
//
|
||||||
|
// Channel proxyChannel = visitorChannel.attr(Constants.NEXT_CHANNEL).get();
|
||||||
|
// if (proxyChannel != null && proxyChannel.isActive()) {
|
||||||
|
// proxyChannel.attr(Constants.NEXT_CHANNEL).remove();
|
||||||
|
// proxyChannel.attr(Constants.LICENSE_ID).remove();
|
||||||
|
// proxyChannel.attr(Constants.VISITOR_ID).remove();
|
||||||
|
//
|
||||||
|
// proxyChannel.config().setOption(ChannelOption.AUTO_READ, true);
|
||||||
|
// // 通知客户端,用户连接已经断开
|
||||||
|
// proxyChannel.writeAndFlush(ProxyMessage.buildDisconnectMessage(visitorId));
|
||||||
|
//
|
||||||
|
// proxyChannel.writeAndFlush(Unpooled.EMPTY_BUFFER).addListener(ChannelFutureListener.CLOSE);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// super.channelInactive(ctx);
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.service;
|
package org.dromara.neutrinoproxy.server.service;
|
||||||
|
|
||||||
import org.dromara.neutrinoproxy.core.util.LockUtil;
|
import org.dromara.neutrinoproxy.core.util.LockUtil;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.service;
|
package org.dromara.neutrinoproxy.server.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.service;
|
package org.dromara.neutrinoproxy.server.service;
|
||||||
|
|
||||||
import org.dromara.neutrinoproxy.server.constant.OnlineStatusEnum;
|
import org.dromara.neutrinoproxy.server.constant.OnlineStatusEnum;
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package org.dromara.neutrinoproxy.server.service;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.solon.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.solon.plugins.pagination.Page;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.ibatis.solon.annotation.Db;
|
import org.apache.ibatis.solon.annotation.Db;
|
||||||
import org.dromara.neutrinoproxy.core.util.DateUtil;
|
import org.dromara.neutrinoproxy.core.util.DateUtil;
|
||||||
import org.dromara.neutrinoproxy.server.base.page.PageInfo;
|
import org.dromara.neutrinoproxy.server.base.page.PageInfo;
|
||||||
@@ -131,6 +132,7 @@ public class UserService {
|
|||||||
|
|
||||||
public PageInfo<UserListRes> page(PageQuery pageQuery, UserListReq req) {
|
public PageInfo<UserListRes> page(PageQuery pageQuery, UserListReq req) {
|
||||||
Page<UserDO> page = userMapper.selectPage(new Page<>(pageQuery.getCurrent(), pageQuery.getSize()), new LambdaQueryWrapper<UserDO>()
|
Page<UserDO> page = userMapper.selectPage(new Page<>(pageQuery.getCurrent(), pageQuery.getSize()), new LambdaQueryWrapper<UserDO>()
|
||||||
|
.like(StringUtils.isNotBlank(req.getName()), UserDO::getName, req.getName())
|
||||||
.orderByAsc(UserDO::getId)
|
.orderByAsc(UserDO::getId)
|
||||||
);
|
);
|
||||||
List<UserListRes> respList = page.getRecords().stream().map(UserDO::toRes).collect(Collectors.toList());
|
List<UserListRes> respList = page.getRecords().stream().map(UserDO::toRes).collect(Collectors.toList());
|
||||||
|
|||||||
@@ -15,17 +15,11 @@ import org.dromara.neutrinoproxy.server.dal.entity.LicenseDO;
|
|||||||
import org.dromara.neutrinoproxy.server.dal.entity.PortMappingDO;
|
import org.dromara.neutrinoproxy.server.dal.entity.PortMappingDO;
|
||||||
import org.dromara.neutrinoproxy.server.dal.entity.PortPoolDO;
|
import org.dromara.neutrinoproxy.server.dal.entity.PortPoolDO;
|
||||||
import org.dromara.neutrinoproxy.server.dal.entity.UserDO;
|
import org.dromara.neutrinoproxy.server.dal.entity.UserDO;
|
||||||
import org.dromara.neutrinoproxy.server.proxy.core.BytesMetricsHandler;
|
|
||||||
import org.dromara.neutrinoproxy.server.proxy.core.TcpVisitorChannelHandler;
|
|
||||||
import org.dromara.neutrinoproxy.server.proxy.domain.CmdChannelAttachInfo;
|
import org.dromara.neutrinoproxy.server.proxy.domain.CmdChannelAttachInfo;
|
||||||
import org.dromara.neutrinoproxy.server.proxy.domain.ProxyMapping;
|
import org.dromara.neutrinoproxy.server.proxy.domain.ProxyMapping;
|
||||||
import org.dromara.neutrinoproxy.server.util.ProxyUtil;
|
import org.dromara.neutrinoproxy.server.util.ProxyUtil;
|
||||||
import io.netty.bootstrap.ServerBootstrap;
|
import io.netty.bootstrap.ServerBootstrap;
|
||||||
import io.netty.channel.Channel;
|
import io.netty.channel.Channel;
|
||||||
import io.netty.channel.ChannelInitializer;
|
|
||||||
import io.netty.channel.nio.NioEventLoopGroup;
|
|
||||||
import io.netty.channel.socket.SocketChannel;
|
|
||||||
import io.netty.channel.socket.nio.NioServerSocketChannel;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.ibatis.solon.annotation.Db;
|
import org.apache.ibatis.solon.annotation.Db;
|
||||||
import org.noear.solon.annotation.Component;
|
import org.noear.solon.annotation.Component;
|
||||||
|
|||||||
@@ -1,24 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2022 aoshiguchen
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
package org.dromara.neutrinoproxy.server.util;
|
package org.dromara.neutrinoproxy.server.util;
|
||||||
|
|
||||||
import java.math.BigInteger;
|
import java.math.BigInteger;
|
||||||
|
|||||||
@@ -4,17 +4,23 @@ import cn.hutool.core.collection.CollectionUtil;
|
|||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.dromara.neutrinoproxy.core.ChannelAttribute;
|
import org.dromara.neutrinoproxy.core.ChannelAttribute;
|
||||||
|
import org.dromara.neutrinoproxy.core.Constants;
|
||||||
import org.dromara.neutrinoproxy.server.constant.NetworkProtocolEnum;
|
import org.dromara.neutrinoproxy.server.constant.NetworkProtocolEnum;
|
||||||
|
import org.dromara.neutrinoproxy.server.controller.res.stats.StatsInfoRes;
|
||||||
import org.dromara.neutrinoproxy.server.proxy.domain.CmdChannelAttachInfo;
|
import org.dromara.neutrinoproxy.server.proxy.domain.CmdChannelAttachInfo;
|
||||||
import org.dromara.neutrinoproxy.server.proxy.domain.ProxyAttachment;
|
|
||||||
import org.dromara.neutrinoproxy.server.proxy.domain.ProxyMapping;
|
import org.dromara.neutrinoproxy.server.proxy.domain.ProxyMapping;
|
||||||
import org.dromara.neutrinoproxy.server.proxy.domain.VisitorChannelAttachInfo;
|
import org.dromara.neutrinoproxy.server.proxy.domain.VisitorChannelAttachInfo;
|
||||||
import io.netty.channel.Channel;
|
import io.netty.channel.Channel;
|
||||||
import io.netty.util.AttributeKey;
|
import io.netty.util.AttributeKey;
|
||||||
|
import org.dromara.solonplugins.job.CustomThreadFactory;
|
||||||
|
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
|
import java.net.SocketAddress;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
import java.util.concurrent.Executors;
|
||||||
|
import java.util.concurrent.ScheduledExecutorService;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.concurrent.atomic.AtomicLong;
|
import java.util.concurrent.atomic.AtomicLong;
|
||||||
import java.util.concurrent.locks.ReadWriteLock;
|
import java.util.concurrent.locks.ReadWriteLock;
|
||||||
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||||
@@ -27,16 +33,16 @@ import java.util.stream.Collectors;
|
|||||||
*/
|
*/
|
||||||
public class ProxyUtil {
|
public class ProxyUtil {
|
||||||
public static final AttributeKey<ChannelAttribute> CHANNEL_ATTR_KEY = AttributeKey.valueOf("netty.channel.attr");
|
public static final AttributeKey<ChannelAttribute> CHANNEL_ATTR_KEY = AttributeKey.valueOf("netty.channel.attr");
|
||||||
/**
|
// /**
|
||||||
* license -> 服务端口映射
|
// * license -> 服务端口映射
|
||||||
*/
|
// */
|
||||||
private static final Map<Integer, Set<Integer>> licenseToServerPortMap = new HashMap<>();
|
// private static final Map<Integer, Set<Integer>> licenseToServerPortMap = new HashMap<>();
|
||||||
/**
|
/**
|
||||||
* 代理信息映射 e.g.: 9104 -> 127.0.0.1:8848
|
* 代理信息映射 e.g.: 9104 -> 127.0.0.1:8848
|
||||||
*/
|
*/
|
||||||
private static final Map<Integer, String> proxyInfoMap = new ConcurrentHashMap<>();
|
private static final Map<Integer, String> proxyInfoMap = new ConcurrentHashMap<>();
|
||||||
/**
|
/**
|
||||||
* 服务端口 -> 指令通道映射
|
* 服务端口 -> 指令通道映射proxyInfoMap
|
||||||
*/
|
*/
|
||||||
private static Map<Integer, Channel> serverPortToCmdChannelMap = new ConcurrentHashMap<>();
|
private static Map<Integer, Channel> serverPortToCmdChannelMap = new ConcurrentHashMap<>();
|
||||||
/**
|
/**
|
||||||
@@ -58,8 +64,10 @@ public class ProxyUtil {
|
|||||||
private static AtomicLong visitorIdProducer = new AtomicLong(0);
|
private static AtomicLong visitorIdProducer = new AtomicLong(0);
|
||||||
/**
|
/**
|
||||||
* 代理 - connect附加映射
|
* 代理 - connect附加映射
|
||||||
|
* (TCP/HTTP场景下,已优化不是用这个。UDP由于无连接,暂时还是要用这个)
|
||||||
|
* UDP场景时,需要记录最后读写时间,使用定时器定期检查,超时需要释放,待后续优化
|
||||||
*/
|
*/
|
||||||
private static Map<String, ProxyAttachment> proxyConnectAttachmentMap = new HashMap<>();
|
private static Map<String, Constants.ProxyAttachment> proxyConnectAttachmentMap = new HashMap<>();
|
||||||
/**
|
/**
|
||||||
* 完整域名 - 服务端端口映射
|
* 完整域名 - 服务端端口映射
|
||||||
*/
|
*/
|
||||||
@@ -72,6 +80,58 @@ public class ProxyUtil {
|
|||||||
* licenseId - 客户端Id映射
|
* licenseId - 客户端Id映射
|
||||||
*/
|
*/
|
||||||
private static Map<Integer, String> licenseIdToClientIdMap = new HashMap<>();
|
private static Map<Integer, String> licenseIdToClientIdMap = new HashMap<>();
|
||||||
|
/**
|
||||||
|
* visitorId - SocketAddress映射
|
||||||
|
*/
|
||||||
|
private static Map<String, SocketAddress> visitorIdToSocketAddressMap = new HashMap<>();
|
||||||
|
/**
|
||||||
|
* SocketAddress - visitorId 映射
|
||||||
|
*/
|
||||||
|
private static Map<SocketAddress, String> socketAddressToVisitorIdMap = new HashMap<>();
|
||||||
|
/**
|
||||||
|
* visitorId - tunnelChannel 映射
|
||||||
|
*/
|
||||||
|
private static Map<String, Channel> visitorIdToTunnelChannelMap = new HashMap<>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* cache扫描器
|
||||||
|
*/
|
||||||
|
private static final ScheduledExecutorService cacheScanner = Executors.newSingleThreadScheduledExecutor(new CustomThreadFactory("cacheScanner"));
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 初始化,启动一个定时器,定时清理缓存
|
||||||
|
*/
|
||||||
|
public static void init() {
|
||||||
|
cacheScanner.scheduleWithFixedDelay(ProxyUtil::cacheScan, 5, 5, TimeUnit.SECONDS);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static synchronized void cacheScan() {
|
||||||
|
for (Integer key : serverPortToCmdChannelMap.keySet()) {
|
||||||
|
Channel channel = serverPortToCmdChannelMap.get(key);
|
||||||
|
if (null == channel || !channel.isRegistered()) {
|
||||||
|
serverPortToCmdChannelMap.remove(key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (Integer key : licenseToCmdChannelMap.keySet()) {
|
||||||
|
Channel channel = licenseToCmdChannelMap.get(key);
|
||||||
|
if (null == channel || !channel.isRegistered()) {
|
||||||
|
licenseToCmdChannelMap.remove(key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (Integer key : serverPortToVisitorChannel.keySet()) {
|
||||||
|
Channel channel = serverPortToVisitorChannel.get(key);
|
||||||
|
if (null == channel || !channel.isRegistered()) {
|
||||||
|
serverPortToVisitorChannel.remove(key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (String key : visitorIdToTunnelChannelMap.keySet()) {
|
||||||
|
Channel channel = visitorIdToTunnelChannelMap.get(key);
|
||||||
|
if (null == channel || !channel.isRegistered()) {
|
||||||
|
visitorIdToTunnelChannelMap.remove(key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 初始化代理信息
|
* 初始化代理信息
|
||||||
@@ -79,14 +139,14 @@ public class ProxyUtil {
|
|||||||
* @param proxyMappingList 代理映射集合
|
* @param proxyMappingList 代理映射集合
|
||||||
*/
|
*/
|
||||||
public static void initProxyInfo(Integer licenseId, List<ProxyMapping> proxyMappingList) {
|
public static void initProxyInfo(Integer licenseId, List<ProxyMapping> proxyMappingList) {
|
||||||
licenseToServerPortMap.put(licenseId, new HashSet<>());
|
// licenseToServerPortMap.put(licenseId, new HashSet<>());
|
||||||
addProxyInfo(licenseId, proxyMappingList);
|
addProxyInfo(licenseId, proxyMappingList);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void addProxyInfo(Integer licenseId, List<ProxyMapping> proxyMappingList) {
|
public static void addProxyInfo(Integer licenseId, List<ProxyMapping> proxyMappingList) {
|
||||||
if (!CollectionUtil.isEmpty(proxyMappingList)) {
|
if (!CollectionUtil.isEmpty(proxyMappingList)) {
|
||||||
for (ProxyMapping proxyMapping : proxyMappingList) {
|
for (ProxyMapping proxyMapping : proxyMappingList) {
|
||||||
licenseToServerPortMap.get(licenseId).add(proxyMapping.getServerPort());
|
// licenseToServerPortMap.get(licenseId).add(proxyMapping.getServerPort());
|
||||||
proxyInfoMap.put(proxyMapping.getServerPort(), proxyMapping.getLanInfo());
|
proxyInfoMap.put(proxyMapping.getServerPort(), proxyMapping.getLanInfo());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -96,7 +156,7 @@ public class ProxyUtil {
|
|||||||
if (null == licenseId || null == proxyMapping) {
|
if (null == licenseId || null == proxyMapping) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
licenseToServerPortMap.get(licenseId).add(proxyMapping.getServerPort());
|
// licenseToServerPortMap.get(licenseId).add(proxyMapping.getServerPort());
|
||||||
proxyInfoMap.put(proxyMapping.getServerPort(), proxyMapping.getLanInfo());
|
proxyInfoMap.put(proxyMapping.getServerPort(), proxyMapping.getLanInfo());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -104,14 +164,14 @@ public class ProxyUtil {
|
|||||||
proxyInfoMap.remove(serverPort);
|
proxyInfoMap.remove(serverPort);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* 根据licenseId获取服务端端口集合
|
// * 根据licenseId获取服务端端口集合
|
||||||
* @param licenseId licenseId
|
// * @param licenseId licenseId
|
||||||
* @return 服务端端口集合
|
// * @return 服务端端口集合
|
||||||
*/
|
// */
|
||||||
public static Set<Integer> getServerPortsByLicenseKey(Integer licenseId) {
|
// public static Set<Integer> getServerPortsByLicenseKey(Integer licenseId) {
|
||||||
return licenseToServerPortMap.get(licenseId);
|
// return licenseToServerPortMap.get(licenseId);
|
||||||
}
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据服务端端口获取客户端代理信息
|
* 根据服务端端口获取客户端代理信息
|
||||||
@@ -321,7 +381,7 @@ public class ProxyUtil {
|
|||||||
* @param visitorId
|
* @param visitorId
|
||||||
* @param proxyAttachment
|
* @param proxyAttachment
|
||||||
*/
|
*/
|
||||||
public static void addProxyConnectAttachment(String visitorId, ProxyAttachment proxyAttachment) {
|
public static void addProxyConnectAttachment(String visitorId, Constants.ProxyAttachment proxyAttachment) {
|
||||||
proxyConnectAttachmentMap.put(visitorId, proxyAttachment);
|
proxyConnectAttachmentMap.put(visitorId, proxyAttachment);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -330,7 +390,7 @@ public class ProxyUtil {
|
|||||||
* @param visitorId
|
* @param visitorId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static ProxyAttachment getProxyConnectAttachment(String visitorId) {
|
public static Constants.ProxyAttachment getProxyConnectAttachment(String visitorId) {
|
||||||
return proxyConnectAttachmentMap.get(visitorId);
|
return proxyConnectAttachmentMap.get(visitorId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -401,11 +461,12 @@ public class ProxyUtil {
|
|||||||
* 通过完整域名获取域名id
|
* 通过完整域名获取域名id
|
||||||
*/
|
*/
|
||||||
public static Integer getDomainNameIdByFullDomain(String fullDomain) {
|
public static Integer getDomainNameIdByFullDomain(String fullDomain) {
|
||||||
List<String> domains = domainToDomainNameIdMap.keySet().stream().filter(item -> fullDomain.endsWith(item)).collect(Collectors.toList());
|
List<String> domains = domainToDomainNameIdMap.keySet().stream().sorted((a,b) -> b.length() - a.length()).filter(item -> fullDomain.endsWith(item)).collect(Collectors.toList());
|
||||||
// 不存在 或者 有多条记录,返回null
|
// 不存在,返回null
|
||||||
if (CollectionUtil.isEmpty(domains) || domains.size() > 1) {
|
if (CollectionUtil.isEmpty(domains)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
// 优先匹配最长的域名,默认取第一个,后续思考如何优化
|
||||||
return getDomainNameIdByDomain(domains.get(0));
|
return getDomainNameIdByDomain(domains.get(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -413,9 +474,9 @@ public class ProxyUtil {
|
|||||||
* 通过完整域名获取域名
|
* 通过完整域名获取域名
|
||||||
*/
|
*/
|
||||||
public static String getDomainNameByFullDomain(String fullDomain) {
|
public static String getDomainNameByFullDomain(String fullDomain) {
|
||||||
List<String> domains = domainToDomainNameIdMap.keySet().stream().filter(item -> fullDomain.endsWith(item)).collect(Collectors.toList());
|
List<String> domains = domainToDomainNameIdMap.keySet().stream().sorted((a,b) -> b.length() - a.length()).filter(item -> fullDomain.endsWith(item)).collect(Collectors.toList());
|
||||||
// 不存在 或者 有多条记录,返回null
|
// 不存在 或者 有多条记录,返回null
|
||||||
if (CollectionUtil.isEmpty(domains) || domains.size() > 1) {
|
if (CollectionUtil.isEmpty(domains)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return domains.getFirst();
|
return domains.getFirst();
|
||||||
@@ -435,7 +496,7 @@ public class ProxyUtil {
|
|||||||
if (StringUtils.isBlank(visitorId)) {
|
if (StringUtils.isBlank(visitorId)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ProxyAttachment proxyAttachment = ProxyUtil.getProxyConnectAttachment(visitorId);
|
Constants.ProxyAttachment proxyAttachment = ProxyUtil.getProxyConnectAttachment(visitorId);
|
||||||
if (null != proxyAttachment) {
|
if (null != proxyAttachment) {
|
||||||
tryClose(channel);
|
tryClose(channel);
|
||||||
}
|
}
|
||||||
@@ -478,4 +539,50 @@ public class ProxyUtil {
|
|||||||
public static void removeClientIdByLicenseId(Integer licenseId) {
|
public static void removeClientIdByLicenseId(Integer licenseId) {
|
||||||
licenseIdToClientIdMap.remove(licenseId);
|
licenseIdToClientIdMap.remove(licenseId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void setVisitorIdToSocketAddressMap(String visitorId, SocketAddress socketAddress) {
|
||||||
|
visitorIdToSocketAddressMap.put(visitorId, socketAddress);
|
||||||
|
socketAddressToVisitorIdMap.put(socketAddress, visitorId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static SocketAddress getSocketAddressByVisitorId(String visitorId) {
|
||||||
|
return visitorIdToSocketAddressMap.get(visitorId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void removeSocketAddressByVisitorId(String visitorId) {
|
||||||
|
SocketAddress socketAddress = visitorIdToSocketAddressMap.get(visitorId);
|
||||||
|
visitorIdToSocketAddressMap.remove(visitorId);
|
||||||
|
socketAddressToVisitorIdMap.remove(socketAddress);
|
||||||
|
|
||||||
|
visitorIdToTunnelChannelMap.remove(visitorId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getVisitorIdBySocketAddress(SocketAddress socketAddress) {
|
||||||
|
return socketAddressToVisitorIdMap.get(socketAddress);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setVisitorIdToTunnelChannelMap(String visitorId, Channel tunnelChannel) {
|
||||||
|
visitorIdToTunnelChannelMap.put(visitorId, tunnelChannel);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Channel getTunnelChannelByVisitorId(String visitorId) {
|
||||||
|
return visitorIdToTunnelChannelMap.get(visitorId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static StatsInfoRes.CacheInfo getCacheInfo() {
|
||||||
|
return new StatsInfoRes.CacheInfo()
|
||||||
|
.setProxyInfoMapSize(proxyInfoMap.size())
|
||||||
|
.setServerPortToCmdChannelMapSize(serverPortToCmdChannelMap.size())
|
||||||
|
.setLicenseToCmdChannelMapSize(licenseToCmdChannelMap.size())
|
||||||
|
.setServerPortToVisitorChannelMapSize(serverPortToVisitorChannel.size())
|
||||||
|
.setProxyConnectAttachmentMapSize(proxyConnectAttachmentMap.size())
|
||||||
|
.setFullDomainToServerPortMapSize(fullDomainToServerPortMap.size())
|
||||||
|
.setDomainToDomainNameIdMapSize(domainToDomainNameIdMap.size())
|
||||||
|
.setLicenseIdToClientIdMapSize(licenseIdToClientIdMap.size())
|
||||||
|
.setVisitorIdToSocketAddressMapSize(visitorIdToSocketAddressMap.size())
|
||||||
|
.setSocketAddressToVisitorIdMapSize(socketAddressToVisitorIdMap.size())
|
||||||
|
.setVisitorIdToTunnelChannelMapSize(visitorIdToTunnelChannelMap.size())
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
server:
|
server:
|
||||||
# 服务端web端口,用于支持HTTP接口,管理后台页面访问
|
# 服务端web端口,用于支持HTTP接口,管理后台页面访问
|
||||||
port: 8888
|
port: ${WEB_PORT:8888}
|
||||||
# 日志级别
|
# 日志级别
|
||||||
solon.logging:
|
solon.logging:
|
||||||
logger:
|
logger:
|
||||||
@@ -12,15 +12,18 @@ solon.logging:
|
|||||||
|
|
||||||
neutrino:
|
neutrino:
|
||||||
proxy:
|
proxy:
|
||||||
|
protocol:
|
||||||
|
# 高低水位线,如:32KB/64KB、32KB/1MB、1MB/5MB
|
||||||
|
# water-mark: 1MB/8MB
|
||||||
# 隧道相关配置-用于维持服务端与客户端的通信
|
# 隧道相关配置-用于维持服务端与客户端的通信
|
||||||
tunnel:
|
tunnel:
|
||||||
# 线程池相关配置,用于技术调优,可忽略
|
# 线程池相关配置,用于技术调优,可忽略
|
||||||
boss-thread-count: 2
|
boss-thread-count: 2
|
||||||
work-thread-count: 10
|
work-thread-count: 10
|
||||||
# 隧道非SSL端口
|
# 隧道非SSL端口
|
||||||
port: 9000
|
port: ${OPEN_PORT:9000}
|
||||||
# 隧道SSL端口
|
# 隧道SSL端口
|
||||||
ssl-port: 9002
|
ssl-port: ${SSL_PORT:9002}
|
||||||
# 隧道SSL证书配置
|
# 隧道SSL证书配置
|
||||||
key-store-password: 123456
|
key-store-password: 123456
|
||||||
key-manager-password: 123456
|
key-manager-password: 123456
|
||||||
@@ -35,9 +38,9 @@ neutrino:
|
|||||||
boss-thread-count: 5
|
boss-thread-count: 5
|
||||||
work-thread-count: 20
|
work-thread-count: 20
|
||||||
# http代理端口,默认80(不配置不支持)
|
# http代理端口,默认80(不配置不支持)
|
||||||
http-proxy-port: 80
|
http-proxy-port: ${HTTP_PROXY_PORT:80}
|
||||||
# https代理端口,默认443 (不配置不支持,同时需要配置域名、证书)
|
# https代理端口,默认443 (不配置不支持,同时需要配置域名、证书)
|
||||||
https-proxy-port: 443
|
https-proxy-port: ${HTTPS_PROXY_PORT:443}
|
||||||
# 是否开启代理服务报文日志(日志级别为debug时开启才有效)
|
# 是否开启代理服务报文日志(日志级别为debug时开启才有效)
|
||||||
transfer-log-enable: false
|
transfer-log-enable: false
|
||||||
udp:
|
udp:
|
||||||
@@ -49,10 +52,10 @@ neutrino:
|
|||||||
data:
|
data:
|
||||||
db:
|
db:
|
||||||
# 数据库类型,目前支持h2、mysql、mariadb
|
# 数据库类型,目前支持h2、mysql、mariadb
|
||||||
type: h2
|
type: ${DB_TYPE:h2}
|
||||||
# 数据库连接URL
|
# 数据库连接URL
|
||||||
url: jdbc:h2:file:./data/db;MODE=MySQL;AUTO_SERVER=TRUE
|
url: ${DB_URL:jdbc:h2:file:./data/db;MODE=MySQL;AUTO_SERVER=TRUE}
|
||||||
# 数据库用户名
|
# 数据库用户名
|
||||||
username:
|
username: ${DB_USER:}
|
||||||
# 数据库密码
|
# 数据库密码
|
||||||
password:
|
password: ${DB_PASSWORD:}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ server:
|
|||||||
solon:
|
solon:
|
||||||
app:
|
app:
|
||||||
name: neutrino-proxy-server
|
name: neutrino-proxy-server
|
||||||
version: 2.0.1
|
version: 2.0.4
|
||||||
config:
|
config:
|
||||||
add: ./app.yml
|
add: ./app.yml
|
||||||
# 日志级别
|
# 日志级别
|
||||||
@@ -32,6 +32,8 @@ neutrino:
|
|||||||
read-idle-time: 120
|
read-idle-time: 120
|
||||||
write-idle-time: 20
|
write-idle-time: 20
|
||||||
all-idle-time-seconds: 0
|
all-idle-time-seconds: 0
|
||||||
|
# 高低水位线,如:32KB/64KB、32KB/1MB、1MB/5MB
|
||||||
|
# water-mark: 1MB/8MB
|
||||||
# 隧道相关配置-用于维持服务端与客户端的通信
|
# 隧道相关配置-用于维持服务端与客户端的通信
|
||||||
tunnel:
|
tunnel:
|
||||||
# 线程池相关配置,用于技术调优,可忽略
|
# 线程池相关配置,用于技术调优,可忽略
|
||||||
|
|||||||
@@ -48,7 +48,7 @@
|
|||||||
LEFT JOIN `user` u ON l.user_id = u.id
|
LEFT JOIN `user` u ON l.user_id = u.id
|
||||||
LEFT JOIN (SELECT license_id,sum(write_bytes) write_bytes,sum(read_bytes) read_bytes from flow_report_month GROUP BY license_id) frm ON l.id = frm.license_id
|
LEFT JOIN (SELECT license_id,sum(write_bytes) write_bytes,sum(read_bytes) read_bytes from flow_report_month GROUP BY license_id) frm ON l.id = frm.license_id
|
||||||
LEFT JOIN (SELECT license_id,sum(write_bytes) write_bytes,sum(read_bytes) read_bytes from flow_report_day
|
LEFT JOIN (SELECT license_id,sum(write_bytes) write_bytes,sum(read_bytes) read_bytes from flow_report_day
|
||||||
WHERE date >= #{curMonthBeginDate} AND #{curDayBeginDate}
|
WHERE date >= #{curMonthBeginDate} AND date <= #{curDayBeginDate}
|
||||||
GROUP BY license_id) frd ON l.id = frd.license_id
|
GROUP BY license_id) frd ON l.id = frd.license_id
|
||||||
LEFT JOIN (SELECT license_id,sum(write_bytes) write_bytes,sum(read_bytes) read_bytes from flow_report_minute
|
LEFT JOIN (SELECT license_id,sum(write_bytes) write_bytes,sum(read_bytes) read_bytes from flow_report_minute
|
||||||
WHERE date >= #{curDayBeginDate} AND date <= #{curDate}
|
WHERE date >= #{curDayBeginDate} AND date <= #{curDate}
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ CREATE TABLE IF NOT EXISTS `port_mapping` (
|
|||||||
`license_id` INTEGER(20) NOT NULL,
|
`license_id` INTEGER(20) NOT NULL,
|
||||||
`protocal` VARCHAR(10) NOT NULL DEFAULT 'TCP',
|
`protocal` VARCHAR(10) NOT NULL DEFAULT 'TCP',
|
||||||
`server_port` INTEGER NOT NULL,
|
`server_port` INTEGER NOT NULL,
|
||||||
`client_ip` VARCHAR(20) NOT NULL,
|
`client_ip` VARCHAR(255) NOT NULL,
|
||||||
`client_port` INTEGER NOT NULL,
|
`client_port` INTEGER NOT NULL,
|
||||||
`up_limit_rate` VARCHAR(20) DEFAULT NULL,
|
`up_limit_rate` VARCHAR(20) DEFAULT NULL,
|
||||||
`down_limit_rate` VARCHAR(20) DEFAULT NULL,
|
`down_limit_rate` VARCHAR(20) DEFAULT NULL,
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ CREATE TABLE IF NOT EXISTS `port_mapping` (
|
|||||||
`license_id` int NOT NULL COMMENT 'licenseID',
|
`license_id` int NOT NULL COMMENT 'licenseID',
|
||||||
`protocal` varchar(10) NOT NULL DEFAULT 'TCP' COMMENT '协议',
|
`protocal` varchar(10) NOT NULL DEFAULT 'TCP' COMMENT '协议',
|
||||||
`server_port` int NOT NULL COMMENT '服务端端口',
|
`server_port` int NOT NULL COMMENT '服务端端口',
|
||||||
`client_ip` varchar(20) NOT NULL COMMENT '客户端IP',
|
`client_ip` varchar(255) NOT NULL COMMENT '客户端IP',
|
||||||
`client_port` int NOT NULL COMMENT '客户端端口',
|
`client_port` int NOT NULL COMMENT '客户端端口',
|
||||||
`up_limit_rate` varchar(20) DEFAULT NULL COMMENT '上传限速',
|
`up_limit_rate` varchar(20) DEFAULT NULL COMMENT '上传限速',
|
||||||
`down_limit_rate` varchar(20) DEFAULT NULL COMMENT '下载限速',
|
`down_limit_rate` varchar(20) DEFAULT NULL COMMENT '下载限速',
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ CREATE TABLE IF NOT EXISTS `port_mapping` (
|
|||||||
`license_id` int NOT NULL COMMENT 'licenseID',
|
`license_id` int NOT NULL COMMENT 'licenseID',
|
||||||
`protocal` varchar(10) NOT NULL DEFAULT 'TCP' COMMENT '协议',
|
`protocal` varchar(10) NOT NULL DEFAULT 'TCP' COMMENT '协议',
|
||||||
`server_port` int NOT NULL COMMENT '服务端端口',
|
`server_port` int NOT NULL COMMENT '服务端端口',
|
||||||
`client_ip` varchar(20) NOT NULL COMMENT '客户端IP',
|
`client_ip` varchar(255) NOT NULL COMMENT '客户端IP',
|
||||||
`client_port` int NOT NULL COMMENT '客户端端口',
|
`client_port` int NOT NULL COMMENT '客户端端口',
|
||||||
`up_limit_rate` varchar(20) DEFAULT NULL COMMENT '上传限速',
|
`up_limit_rate` varchar(20) DEFAULT NULL COMMENT '上传限速',
|
||||||
`down_limit_rate` varchar(20) DEFAULT NULL COMMENT '下载限速',
|
`down_limit_rate` varchar(20) DEFAULT NULL COMMENT '下载限速',
|
||||||
|
|||||||
@@ -8,3 +8,5 @@
|
|||||||
[主题仓库](https://github.com/xugaoyi/vuepress-theme-vdoing)
|
[主题仓库](https://github.com/xugaoyi/vuepress-theme-vdoing)
|
||||||
|
|
||||||
[本仓库的gitee镜像](https://gitee.com/xugaoyi/vuepress-theme-vdoing-doc)
|
[本仓库的gitee镜像](https://gitee.com/xugaoyi/vuepress-theme-vdoing-doc)
|
||||||
|
|
||||||
|
hello11
|
||||||
|
|||||||
@@ -9,7 +9,8 @@ module.exports = {
|
|||||||
|
|
||||||
title: "中微子代理",
|
title: "中微子代理",
|
||||||
description: '一个基于Netty的开源内网穿透神器',
|
description: '一个基于Netty的开源内网穿透神器',
|
||||||
base: '/neutrino-proxy/', // 默认'/'。如果你想将你的网站部署到如 https://foo.github.io/bar/,那么 base 应该被设置成 "/bar/",(否则页面将失去样式等文件)
|
// base: '/neutrino-proxy/', // 默认'/'。如果你想将你的网站部署到如 https://foo.github.io/bar/,那么 base 应该被设置成 "/bar/",(否则页面将失去样式等文件)
|
||||||
|
base: '/',
|
||||||
head: [ // 注入到页面<head> 中的标签,格式[tagName, { attrName: attrValue }, innerHTML?]
|
head: [ // 注入到页面<head> 中的标签,格式[tagName, { attrName: attrValue }, innerHTML?]
|
||||||
['link', {rel: 'icon', href: '/img/favicon.ico'}], //favicons,资源放在public文件夹
|
['link', {rel: 'icon', href: '/img/favicon.ico'}], //favicons,资源放在public文件夹
|
||||||
['meta', {name: 'keywords', content: 'vuepress,theme,blog,vdoing'}],
|
['meta', {name: 'keywords', content: 'vuepress,theme,blog,vdoing'}],
|
||||||
@@ -33,6 +34,7 @@ module.exports = {
|
|||||||
{text: '案例', link: '/pages/5d571c/'},
|
{text: '案例', link: '/pages/5d571c/'},
|
||||||
{text: '支持', link: '/pages/1ab20b/'},
|
{text: '支持', link: '/pages/1ab20b/'},
|
||||||
{text: '更新记录', link: '/pages/ff3519/'},
|
{text: '更新记录', link: '/pages/ff3519/'},
|
||||||
|
{text: 'GitCode', link: 'https://gitcode.com/dromara/neutrino-proxy'},
|
||||||
{text: 'Gitee', link: 'https://gitee.com/dromara/neutrino-proxy'},
|
{text: 'Gitee', link: 'https://gitee.com/dromara/neutrino-proxy'},
|
||||||
],
|
],
|
||||||
sidebarDepth: 2, // 侧边栏显示深度,默认1,最大2(显示到h3标题)
|
sidebarDepth: 2, // 侧边栏显示深度,默认1,最大2(显示到h3标题)
|
||||||
|
|||||||
|
After Width: | Height: | Size: 167 KiB |
|
After Width: | Height: | Size: 159 KiB |
|
After Width: | Height: | Size: 186 KiB |
|
After Width: | Height: | Size: 217 KiB |
|
After Width: | Height: | Size: 166 KiB |
|
After Width: | Height: | Size: 87 KiB |
@@ -6,7 +6,7 @@ article: false
|
|||||||
---
|
---
|
||||||
|
|
||||||
::: tip
|
::: tip
|
||||||
当前最新版本:2.0.1。从之前的版本升级过来,请参照:更新记录 > 版本记录
|
当前最新版本:2.0.3。从之前的版本升级过来,请参照:更新记录 > 版本记录.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
## 1、快速上手须知
|
## 1、快速上手须知
|
||||||
@@ -16,8 +16,7 @@ article: false
|
|||||||
- 快速上手中涉及到的配置,仅仅是快速体验所必须的配置,完整的配置请参照使用须知中的`服务端配置`、`客户端配置`
|
- 快速上手中涉及到的配置,仅仅是快速体验所必须的配置,完整的配置请参照使用须知中的`服务端配置`、`客户端配置`
|
||||||
|
|
||||||
## 2、部署服务
|
## 2、部署服务
|
||||||
- 根据需要自行选择jar、docker、原生部署任意一种完成部署
|
- 根据需要自行选择宝塔面板、jar、docker、原生部署、docker-compose任意一种完成部署,分别参见对应的文档
|
||||||
- 三种方式分别参见对应的文档
|
|
||||||
- 任何一种部署方式,不要求客户端与服务端一致。如:服务端采用docker部署,客户端可以用docker部署、也可以用jar、原生部署
|
- 任何一种部署方式,不要求客户端与服务端一致。如:服务端采用docker部署,客户端可以用docker部署、也可以用jar、原生部署
|
||||||
- 管理后台说明
|
- 管理后台说明
|
||||||
- 服务端部署成功后,访问http://{服务端IP}:8888打开后台管理页面。使用默认的管理员帐号登录:admin/123456
|
- 服务端部署成功后,访问http://{服务端IP}:8888打开后台管理页面。使用默认的管理员帐号登录:admin/123456
|
||||||
|
|||||||
@@ -0,0 +1,43 @@
|
|||||||
|
---
|
||||||
|
title: 通过宝塔面板部署
|
||||||
|
date: 2024-23-20 13:32:00
|
||||||
|
permalink: /pages/9e0fde/
|
||||||
|
article: false
|
||||||
|
---
|
||||||
|
|
||||||
|
## 前提
|
||||||
|
- 仅适用于宝塔面板9.2.0及以上版本
|
||||||
|
- 安装宝塔面板,前往[宝塔面板](https://www.bt.cn/new/download.html?r=dk_neuproxy)官网,选择正式版的脚本下载安装
|
||||||
|
|
||||||
|
## 部署
|
||||||
|
#### 1、登录宝塔面板,在左侧菜单栏中点击`Docker`
|
||||||
|
|
||||||
|
<img :src="$withBase('/img/baota/step1.png')"></img>
|
||||||
|
|
||||||
|
#### 2、首次会提示安装Docker和Docker Compose服务,点击立即安装,若已安装请忽略。
|
||||||
|
|
||||||
|
<img :src="$withBase('/img/baota/step2.png')"></img>
|
||||||
|
|
||||||
|
#### 3、安装完成后在Docker-应用商店中找到 中微子代理(搜索“NeutrinoProxy”),点击安装
|
||||||
|
|
||||||
|
<img :src="$withBase('/img/baota/step3.png')"></img>
|
||||||
|
|
||||||
|
#### 4、设置基本信息,点击确定
|
||||||
|
- 名称:应用名称,默认`neuproxy_随机字符`
|
||||||
|
- 版本:默认`latest`
|
||||||
|
- 允许外部访问:如您需通过`IP+Port`直接访问,请勾选,如您已经设置了域名,请不要勾选此处
|
||||||
|
- web管理端口:默认`9988`,可自行修改
|
||||||
|
- 客户端连接端口:默认`9989`,可自行修改
|
||||||
|
- 客户端SSL连接端口:默认`9990`,可自行修改
|
||||||
|
|
||||||
|
<img :src="$withBase('/img/baota/step4.png')"></img>
|
||||||
|
|
||||||
|
#### 5、提交后面板会自动进行应用初始化,大概需要`1-3`分钟,初始化完成后即可访问。
|
||||||
|
- 如果部署失败,可能是从DockerHub拉取镜像失败,可以自行设置镜像加速。
|
||||||
|
|
||||||
|
<img :src="$withBase('/img/baota/step5.png')"></img>
|
||||||
|
|
||||||
|
#### 6、访问中微子代理管理后台
|
||||||
|
<img :src="$withBase('/img/baota/step6.png')"></img>
|
||||||
|
|
||||||
|
|
||||||
@@ -6,12 +6,12 @@ permalink: /pages/eebea1/
|
|||||||
|
|
||||||
## 1、环境准备
|
## 1、环境准备
|
||||||
- 首先确保已安装Java21运行环境
|
- 首先确保已安装Java21运行环境
|
||||||
- 打开[发行版页面](https://gitee.com/dromara/neutrino-proxy/releases),下载最新的release包:`neutrino-proxy-server-jdk21-2.0.1-jar.zip`、`neutrino-proxy-client-jdk21-2.0.1-jar.zip`
|
- 打开[发行版页面](https://gitee.com/dromara/neutrino-proxy/releases),下载最新的release包:`neutrino-proxy-server-jdk21-2.0.2-jar.zip`、`neutrino-proxy-client-jdk21-2.0.2-jar.zip`
|
||||||
|
- 百度网盘下载速度慢?[点击这里加速](https://docs.xigexb.com/s/neutrino-proxy/doc/neutrino-proxy-CROFc0fdYh),此站点由[喜鸽小宝](https://www.xigexb.com)提供。
|
||||||
|
|
||||||
## 2、部署服务端
|
## 2、部署服务端
|
||||||
- 在服务器上新建部署目录:`/work/projects/neutrino-proxy-server`
|
- 在服务器上新建部署目录:`/work/projects/neutrino-proxy-server`
|
||||||
- 将`neutrino-proxy-server-jdk21-2.0.1-jar.zip`上传至服务器部署目录,并解压
|
- 将`neutrino-proxy-server-jdk21-2.0.2-jar.zip`上传至服务器部署目录,并解压
|
||||||
- 执行命令`java -Dfile.encoding=utf-8 -jar neutrino-proxy-server.jar`启动服务端完成部署,默认使用h2数据库。
|
- 执行命令`java -Dfile.encoding=utf-8 -jar neutrino-proxy-server.jar`启动服务端完成部署,默认使用h2数据库。
|
||||||
- 若需要指定自己的mysql数据库,则需要在当前目录下的`app.yml`文件中,修改数据库配置如下:
|
- 若需要指定自己的mysql数据库,则需要在当前目录下的`app.yml`文件中,修改数据库配置如下:
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@ neutrino:
|
|||||||
- 可参照 https://gitee.com/dromara/neutrino-proxy/blob/master/scripts/unix/server_start.sh 使用shell脚本启动服务端。
|
- 可参照 https://gitee.com/dromara/neutrino-proxy/blob/master/scripts/unix/server_start.sh 使用shell脚本启动服务端。
|
||||||
|
|
||||||
## 3、部署客户端
|
## 3、部署客户端
|
||||||
- 本地解压`neutrino-proxy-client-jdk21-2.0.1-jar.zip`文件
|
- 本地解压`neutrino-proxy-client-jdk21-2.0.2-jar.zip`文件
|
||||||
- 修改`app.yml`文件中的server-ip为服务器公网ip,并配置license-key,以下是相关的部分配置:
|
- 修改`app.yml`文件中的server-ip为服务器公网ip,并配置license-key,以下是相关的部分配置:
|
||||||
```yml
|
```yml
|
||||||
neutrino:
|
neutrino:
|
||||||
@@ -5,6 +5,8 @@ permalink: /pages/5b9bef/
|
|||||||
---
|
---
|
||||||
|
|
||||||
## 1、 部署服务端
|
## 1、 部署服务端
|
||||||
|
- dockerHub镜像地址:aoshiguchen/neutrino-proxy-server:latest
|
||||||
|
- 阿里云镜像地址:registry.cn-hangzhou.aliyuncs.com/asgc/neutrino-proxy:latest
|
||||||
### 使用默认h2数据库一键部署
|
### 使用默认h2数据库一键部署
|
||||||
```shell
|
```shell
|
||||||
docker run -it -p 9000-9200:9000-9200/tcp -p 8888:8888 \
|
docker run -it -p 9000-9200:9000-9200/tcp -p 8888:8888 \
|
||||||
@@ -34,6 +36,8 @@ neutrino:
|
|||||||
- 然后再执行上面的docker一键部署命令即可
|
- 然后再执行上面的docker一键部署命令即可
|
||||||
|
|
||||||
## 2、部署客户端
|
## 2、部署客户端
|
||||||
|
- dockerHub镜像地址:aoshiguchen/neutrino-proxy-client:latest
|
||||||
|
- 阿里云镜像地址:registry.cn-hangzhou.aliyuncs.com/asgc/neutrino-proxy-client:latest
|
||||||
- 命令中的服务端ip、license请自行补充
|
- 命令中的服务端ip、license请自行补充
|
||||||
- 若是首次使用,请仔细阅读快速上手,以确定license从哪里取得
|
- 若是首次使用,请仔细阅读快速上手,以确定license从哪里取得
|
||||||
```shell
|
```shell
|
||||||
@@ -18,7 +18,8 @@ permalink: /pages/69699a/
|
|||||||
|
|
||||||
## 1、安装包下载
|
## 1、安装包下载
|
||||||
- 打开[发行版页面](https://gitee.com/dromara/neutrino-proxy/releases),下载所需的最新的release包:
|
- 打开[发行版页面](https://gitee.com/dromara/neutrino-proxy/releases),下载所需的最新的release包:
|
||||||
- 比如服务器为linux则可下载`neutrino-proxy-server-linux-2.0.1-native.zip`文件,客户端为windows则可下载`neutrino-proxy-client-windows-2.0.1-native.zip`
|
- 比如服务器为linux则可下载`neutrino-proxy-server-linux-2.0.2-native.zip`文件,客户端为windows则可下载`neutrino-proxy-client-windows-2.0.2-native.zip`
|
||||||
|
- 百度网盘下载速度慢?[点击这里加速](https://docs.xigexb.com/s/neutrino-proxy/doc/neutrino-proxy-CROFc0fdYh),此站点由[喜鸽小宝](https://www.xigexb.com)提供。
|
||||||
|
|
||||||
## 2、部署服务端
|
## 2、部署服务端
|
||||||
- 将服务端安装包上传至服务器,并解压
|
- 将服务端安装包上传至服务器,并解压
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
---
|
||||||
|
title: 使用docker-compose部署
|
||||||
|
date: 2024-12-07 14:40:50
|
||||||
|
permalink: /pages/2d4123/
|
||||||
|
---
|
||||||
|
|
||||||
|
## 1、 部署服务端
|
||||||
|
### 使用默认h2数据库一键部署
|
||||||
|
- 注意自行修改配置文件:config/app.yml
|
||||||
|
```shell
|
||||||
|
git clone https://gitee.com/dromara/neutrino-proxy.git
|
||||||
|
cd neutrino-proxy/scripts/docker-compose/neutrino-proxy-server-h2
|
||||||
|
docker-compose up -d
|
||||||
|
```
|
||||||
|
|
||||||
|
### 使用默认mysql数据库一键部署
|
||||||
|
- 注意自行修改配置文件:config/app.yml
|
||||||
|
```shell
|
||||||
|
git clone https://gitee.com/dromara/neutrino-proxy.git
|
||||||
|
cd neutrino-proxy/scripts/docker-compose/neutrino-proxy-server-mysql
|
||||||
|
docker-compose up -d
|
||||||
|
```
|
||||||
|
|
||||||
|
## 2、部署客户端
|
||||||
|
- 注意自行修改配置文件:config/app.yml
|
||||||
|
```shell
|
||||||
|
git clone https://gitee.com/dromara/neutrino-proxy.git
|
||||||
|
cd neutrino-proxy/scripts/docker-compose/neutrino-proxy-client
|
||||||
|
docker-compose up -d
|
||||||
|
```
|
||||||
@@ -16,37 +16,12 @@ permalink: /pages/f2d0f1/
|
|||||||
server:
|
server:
|
||||||
# 服务端web端口,用于支持HTTP接口,管理后台页面访问
|
# 服务端web端口,用于支持HTTP接口,管理后台页面访问
|
||||||
port: ${WEB_PORT:8888}
|
port: ${WEB_PORT:8888}
|
||||||
context-path: /neutrino-proxy-server
|
|
||||||
solon:
|
|
||||||
app:
|
|
||||||
name: neutrino-proxy-server
|
|
||||||
version: 2.0.1
|
|
||||||
config:
|
|
||||||
add: ./app.yml
|
|
||||||
# 日志级别
|
|
||||||
solon.logging.appender:
|
|
||||||
console:
|
|
||||||
pattern: "%d{yyyy-MM-dd HH:mm:ss.SSS} %highlight(%-5level) %magenta(${PID:-}) --- %-15([%15.15thread]) %-56(%cyan(%-40.40logger{39}%L)) : %msg%n"
|
|
||||||
file:
|
|
||||||
enable: true
|
|
||||||
pattern: "%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level ${PID:-} --- %-15([%15.15thread]) %-56(%-40.40logger{39}%L) : %msg%n"
|
|
||||||
name: "logs/${solon.app.name}"
|
|
||||||
rolling: "logs/${solon.app.name}_%d{yyyy-MM-dd}_%i.log"
|
|
||||||
solon.logging.logger:
|
|
||||||
"root":
|
|
||||||
level: info
|
|
||||||
|
|
||||||
neutrino:
|
neutrino:
|
||||||
proxy:
|
proxy:
|
||||||
protocol:
|
logger:
|
||||||
max-frame-length: ${MAX_FRAME_LENGTH:2097152}
|
# 日志级别
|
||||||
length-field-offset: 0
|
level: ${LOG_LEVEL:info}
|
||||||
length-field-length: 4
|
|
||||||
initial-bytes-to-strip: 0
|
|
||||||
length-adjustment: 0
|
|
||||||
read-idle-time: 120
|
|
||||||
write-idle-time: 20
|
|
||||||
all-idle-time-seconds: 0
|
|
||||||
# 隧道相关配置-用于维持服务端与客户端的通信
|
# 隧道相关配置-用于维持服务端与客户端的通信
|
||||||
tunnel:
|
tunnel:
|
||||||
# 线程池相关配置,用于技术调优,可忽略
|
# 线程池相关配置,用于技术调优,可忽略
|
||||||
@@ -62,16 +37,14 @@ neutrino:
|
|||||||
jks-path: ${JKS_PATH:classpath:/test.jks}
|
jks-path: ${JKS_PATH:classpath:/test.jks}
|
||||||
# 是否开启隧道传输报文日志(日志级别为debug时开启才有效)
|
# 是否开启隧道传输报文日志(日志级别为debug时开启才有效)
|
||||||
transfer-log-enable: ${TUNNEL_LOG:false}
|
transfer-log-enable: ${TUNNEL_LOG:false}
|
||||||
# 是否开启心跳日志
|
|
||||||
heartbeat-log-enable: ${HEARTBEAT_LOG:false}
|
|
||||||
server:
|
server:
|
||||||
tcp:
|
tcp:
|
||||||
# 线程池相关配置,用于技术调优,可忽略
|
# 线程池相关配置,用于技术调优,可忽略
|
||||||
boss-thread-count: 5
|
boss-thread-count: 5
|
||||||
work-thread-count: 20
|
work-thread-count: 20
|
||||||
# http代理端口,默认80(不配置不支持)
|
# http代理端口,默认80
|
||||||
http-proxy-port: ${HTTP_PROXY_PORT:80}
|
http-proxy-port: ${HTTP_PROXY_PORT:80}
|
||||||
# https代理端口,默认443 (不配置不支持,同时需要配置域名、证书)
|
# https代理端口,默认443 (需要配置域名、证书)
|
||||||
https-proxy-port: ${HTTPS_PROXY_PORT:443}
|
https-proxy-port: ${HTTPS_PROXY_PORT:443}
|
||||||
# 是否开启代理服务报文日志(日志级别为debug时开启才有效)
|
# 是否开启代理服务报文日志(日志级别为debug时开启才有效)
|
||||||
transfer-log-enable: ${SERVER_LOG:false}
|
transfer-log-enable: ${SERVER_LOG:false}
|
||||||
@@ -83,7 +56,7 @@ neutrino:
|
|||||||
transfer-log-enable: ${SERVER_LOG:false}
|
transfer-log-enable: ${SERVER_LOG:false}
|
||||||
data:
|
data:
|
||||||
db:
|
db:
|
||||||
# 数据库类型,目前支持h2、mysql、mariadb
|
# 数据库类型,目前支持sqlite、mysql、mariadb
|
||||||
type: ${DB_TYPE:h2}
|
type: ${DB_TYPE:h2}
|
||||||
# 数据库连接URL
|
# 数据库连接URL
|
||||||
url: ${DB_URL:jdbc:h2:file:./data/db;MODE=MySQL;AUTO_SERVER=TRUE}
|
url: ${DB_URL:jdbc:h2:file:./data/db;MODE=MySQL;AUTO_SERVER=TRUE}
|
||||||
@@ -91,26 +64,4 @@ neutrino:
|
|||||||
username: ${DB_USER:}
|
username: ${DB_USER:}
|
||||||
# 数据库密码
|
# 数据库密码
|
||||||
password: ${DB_PASSWORD:}
|
password: ${DB_PASSWORD:}
|
||||||
|
|
||||||
#添加MIME印射(如果有需要?)
|
|
||||||
#是否启用静态文件服务。(可不配,默认为启用)
|
|
||||||
solon.staticfiles.enable: true
|
|
||||||
#静态文件的304缓存时长。(可不配,默认为10分钟)
|
|
||||||
solon.staticfiles.maxAge: 600
|
|
||||||
#添加静态目录映射。(按需选择)#v1.11.0 后支持
|
|
||||||
solon.staticfiles.mappings:
|
|
||||||
- path: "/"
|
|
||||||
repository: "./neutrino-proxy-admin/dist/" #2.添加资源路径(仓库只能是目录)
|
|
||||||
|
|
||||||
mybatis.db:
|
|
||||||
typeAliases: #支持包名 或 类名(大写开头 或 *)//支持 ** 或 * 占位符
|
|
||||||
- "org.dromara.neutrinoproxy.server.dal.entity"
|
|
||||||
mappers: #支持包名 或 类名(大写开头 或 *)或 xml(.xml结尾)//支持 ** 或 * 占位符
|
|
||||||
- "classpath:mapper/*.xml"
|
|
||||||
- "org.dromara.neutrinoproxy.server.dal"
|
|
||||||
configuration: #扩展配置(要与 MybatisConfiguration 类的属性一一对应)
|
|
||||||
cacheEnabled: false
|
|
||||||
mapUnderscoreToCamelCase: true
|
|
||||||
globalConfig: #全局配置(要与 GlobalConfig 类的属性一一对应)
|
|
||||||
banner: true
|
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
---
|
||||||
|
title: 服务端原声包启动,db初始化异常
|
||||||
|
date: 2024-11-09 15:28:37
|
||||||
|
permalink: /pages/7dcba8/
|
||||||
|
---
|
||||||
|
|
||||||
|
## 1.1、报错“Data truncation: Data too long for column 'name' at row 1”
|
||||||
|
配置文件中配置的mysql连接地址,去掉“characterEncoding=UTF-8”参数
|
||||||
@@ -7,6 +7,14 @@ permalink: /pages/acdf0a/
|
|||||||
|
|
||||||
| 日期 | 渠道 | 金额 |昵称| 备注 |
|
| 日期 | 渠道 | 金额 |昵称| 备注 |
|
||||||
|:-----------|:---|:-----|:-|:--------------------------------------|
|
|:-----------|:---|:-----|:-|:--------------------------------------|
|
||||||
|
| 2024-11-19|支付宝收款码|2|*亮||
|
||||||
|
| 2024-10-06 |Gitee捐助|100|碧云天|感谢您的开源项目!|
|
||||||
|
| 2024-10-14 |微信红包|5|泛微eteams刘新东17699059661|
|
||||||
|
| 2024-09-04 |Gitee捐助|8.88|lusen998|感谢您的开源项目!|
|
||||||
|
| 2024-08-30 | 微信转账|100|吴忧吴虑|
|
||||||
|
| 2024-07-29 |Gitee捐助|10|QuanJWS|感谢您的开源项目!看着很不错的样子,加油! |
|
||||||
|
| 2024-07-29 |微信赞赏码|120|陈某| |
|
||||||
|
| 2024-05-07 |微信转账|100|仲秀| |
|
||||||
| 2024-04-16 |微信转账|100|暮光:城中城| |
|
| 2024-04-16 |微信转账|100|暮光:城中城| |
|
||||||
| 2024-04-03 |微信转账|100|仲秀| 大神,非常感谢 |
|
| 2024-04-03 |微信转账|100|仲秀| 大神,非常感谢 |
|
||||||
| 2024-03-24 |Gitee捐助|10|include|
|
| 2024-03-24 |Gitee捐助|10|include|
|
||||||
|
|||||||
@@ -3,15 +3,27 @@ title: 2.x
|
|||||||
date: 2023-10-26 17:43:43
|
date: 2023-10-26 17:43:43
|
||||||
permalink: /pages/ff3519/
|
permalink: /pages/ff3519/
|
||||||
---
|
---
|
||||||
|
|
||||||
|
## 2.0.3
|
||||||
|
- 紧急bug修复:解决http请求拆包情况下域名映射失效的问题
|
||||||
|
|
||||||
## 2.0.2
|
## 2.0.2
|
||||||
- 新增后台域名管理,⽀持新增、修改、删除、禁⽤主域名,支持添加多级域名。
|
- bug修复
|
||||||
- 新增页面上传域名对应的SSL证书、⽀持设置强制HTTPS、⽀持域名映射⾃动加载对应的服务器证书。
|
- 解决安全组在ipv6场景下误拦截导致域名映射访问不通的问题
|
||||||
- 新增端⼝映射选择切换不同的主域名,⽀持绑定多个⼦域名,单个端⼝⽀持绑定多个不同的主域名。
|
- 解决native编译后,端口池批量删除报错的问题
|
||||||
|
- 解决客户端docker方式部署环境变量指定参数不生效的问题
|
||||||
|
- 服务端解决native下清理日志定时任务报错的问题
|
||||||
|
- 解决后台分页查询的已知问题
|
||||||
|
- 端口映射中的客户端ip字段加长一点,解决配置阿里云数据库域名字段不够的问题
|
||||||
|
- 解决服务端native部署时,访问后台用户列表,日志警告“you should use: nativeMetadata.registerField(field) at aot runtime”的问题
|
||||||
|
- 新增功能
|
||||||
|
- 新增后台域名管理,⽀持新增、修改、删除、禁⽤主域名,支持添加多级域名。
|
||||||
|
- 域名管理支持上传域名对应的SSL证书、⽀持设置强制HTTPS、⽀持域名映射⾃动加载对应的服务器证书。
|
||||||
|
- 端口映射支持选择切换不同的主域名,⽀持绑定多个⼦域名,单个端⼝⽀持绑定多个不同的主域名。
|
||||||
- 升级须知:
|
- 升级须知:
|
||||||
- **域名和SSL证书的配置由配置文件配置改为后台域名管理页面配置。**
|
- **域名和SSL证书的配置由配置文件配置改为后台域名管理页面配置。**
|
||||||
- 去掉了配置文件声明服务器端域名和证书的方式,该为通过页面进行管理。请注意代码更新和数据迁移。
|
- 去掉了配置文件声明服务器端域名和证书的方式,改为通过页面进行管理,请注意自行进行数据迁移。
|
||||||
- 数据库新增`域名表`和`域名映射中间表`,修改了`端口映射表`,涉及到表结构变更,执行[增量SQL](https://gitee.com/dromara/neutrino-proxy/blob/master/neutrino-proxy-server/src/main/resources/sql/mysql/update/UPDATE-20240808.SQL)
|
- 数据库新增`域名表`和`域名映射中间表`,修改了`端口映射表`,涉及到表结构变更,执行[增量SQL](https://gitee.com/dromara/neutrino-proxy/blob/master/neutrino-proxy-server/src/main/resources/sql/mysql/update/UPDATE-20240808.SQL)
|
||||||
- 配置文件做了较大调整,请参照官网使用须知中的`服务端配置`、`客户端配置`进行更新
|
|
||||||
|
|
||||||
## 2.0.1
|
## 2.0.1
|
||||||
- jdk版本升级为21
|
- jdk版本升级为21
|
||||||
|
|||||||
@@ -3,6 +3,10 @@ title: 里程碑
|
|||||||
date: 2023-10-26 17:41:26
|
date: 2023-10-26 17:41:26
|
||||||
permalink: /pages/e406dd/
|
permalink: /pages/e406dd/
|
||||||
---
|
---
|
||||||
|
- 2025-08-14 中微子代理Gitee Star数突破2000
|
||||||
|
- 2024-12-20 中微子代理服务端支持宝塔面板一件部署
|
||||||
|
- 2024-12-10 2.0.2版本发布,新增域名管理,端口映射支持绑定多个域名
|
||||||
|
- 2024-08-12 中微子代理Gitcode 荣获G-Star认证
|
||||||
- 2023-12-21 2.0.1版本发布,jdk版本升级到21,支持安全组(黑/白名单IP限制)、限速
|
- 2023-12-21 2.0.1版本发布,jdk版本升级到21,支持安全组(黑/白名单IP限制)、限速
|
||||||
- 2023-10-31 2.0.0版本发布,升级jdk版本至jdk17、支持原生编译、去掉sqlite改为默认H2数据库
|
- 2023-10-31 2.0.0版本发布,升级jdk版本至jdk17、支持原生编译、去掉sqlite改为默认H2数据库
|
||||||
- 2023-09-25 中微子代理Gitee Star数突破1000
|
- 2023-09-25 中微子代理Gitee Star数突破1000
|
||||||
|
|||||||
@@ -4,8 +4,8 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vuepress dev docs",
|
"dev": "vuepress dev docs",
|
||||||
"build": "vuepress build docs",
|
"build": "vuepress build docs",
|
||||||
"buildAndDeploy": "vuepress build docs && bash deploy/deploy2.sh",
|
"buildAndDeploy": "vuepress build docs && bash deploy/deploy1.sh",
|
||||||
"deploy": "bash deploy/deploy2.sh",
|
"deploy": "bash deploy/deploy1.sh",
|
||||||
"updateTheme": "yarn remove vuepress-theme-vdoing && rm -rf node_modules && yarn && yarn add vuepress-theme-vdoing -D",
|
"updateTheme": "yarn remove vuepress-theme-vdoing && rm -rf node_modules && yarn && yarn add vuepress-theme-vdoing -D",
|
||||||
"editFm": "node utils/editFrontmatter.js"
|
"editFm": "node utils/editFrontmatter.js"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -26,10 +26,9 @@
|
|||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||||
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
|
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
|
||||||
<revision>2.0.1</revision>
|
<revision>2.0.3</revision>
|
||||||
|
|
||||||
<native.version>0.9.28</native.version>
|
<native.version>0.9.28</native.version>
|
||||||
|
|
||||||
<java.version>21</java.version>
|
<java.version>21</java.version>
|
||||||
<maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
|
<maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
|
||||||
<maven-flatten.version>1.1.0</maven-flatten.version>
|
<maven-flatten.version>1.1.0</maven-flatten.version>
|
||||||
|
|||||||
@@ -0,0 +1,35 @@
|
|||||||
|
## 项目简介
|
||||||
|
- [中微子代理(neutrino-proxy)](https://gitee.com/dromara/neutrino-proxy) 是一款基于Solon、Netty的内网穿透神器。该项目采用最为宽松的MIT协议,因此您可以对它进行复制、修改、传播并用于任何个人或商业行为。
|
||||||
|
- 市面上基于内网穿透的常见产品有:花生壳、TeamView、cpolar等。
|
||||||
|
- 常见的使用场景:
|
||||||
|
- 本地开发调试第三方回调
|
||||||
|
- 本地开发异地接口连调
|
||||||
|
- 远程登录内网windows机器
|
||||||
|
- 将本地服务映射到外网,用于演示
|
||||||
|
- Gitee仓库:https://gitee.com/dromara/neutrino-proxy
|
||||||
|
- GitCode仓库:https://gitcode.com/dromara/neutrino-proxy
|
||||||
|
- GitHub仓库:https://github.com/dromara/neutrino-proxy
|
||||||
|
- 官网地址: https://neutrino-proxy.dromara.org
|
||||||
|
|
||||||
|
## 主要特点:
|
||||||
|
- 1、流量监控:首页图表、报表管理多维度流量监控。全方位掌握实时、历史代理数据。
|
||||||
|
- 2、用户/License:支持多用户、多客户端使用。后台禁用实时生效。
|
||||||
|
- 3、端口池:对外端口统一管理,支持用户、License独占端口。
|
||||||
|
- 4、端口映射:新增、编辑、删除、禁用实时生效。
|
||||||
|
- 5、Docker:服务端/客户端支持Docker一键部署。
|
||||||
|
- 6、SSL证书:隧道通信支持SSL加密,保护您的数据安全。
|
||||||
|
- 7、域名映射:支持绑定子域名,方便本地调试三方回调
|
||||||
|
- 8、多种协议:支持代理TCP、HTTP、HTTPS、UDP协议
|
||||||
|
- 9、原生部署:支持编译为原生可执行文件,更低部署门槛、更少内存占用
|
||||||
|
- 10、安全组:支持黑/白名单IP访问限制
|
||||||
|
- 11、限速:支持对License、端口映射限制上传/下载速度
|
||||||
|
- 12、采用最为宽松的MIT协议,免去你的后顾之忧
|
||||||
|
|
||||||
|
## 镜像版本&地址
|
||||||
|
- 版本:当前最新版本为`2.0.1`,可直接使用`latest`拉取最新镜像
|
||||||
|
- neutrino-proxy-server
|
||||||
|
- DockerHub镜像地址:aoshiguchen/neutrino-proxy-server:latest
|
||||||
|
- 阿里云镜像地址:neutrino-proxy registry.cn-hangzhou.aliyuncs.com/asgc/neutrino-proxy:latest
|
||||||
|
- neutrino-proxy-client
|
||||||
|
- DockerHub镜像地址:aoshiguchen/neutrino-proxy-client:latest
|
||||||
|
- 阿里云镜像地址:registry.cn-hangzhou.aliyuncs.com/asgc/neutrino-proxy-client:latest
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
solon.logging.logger:
|
||||||
|
"root":
|
||||||
|
level: info
|
||||||
|
|
||||||
|
neutrino:
|
||||||
|
proxy:
|
||||||
|
tunnel:
|
||||||
|
# 线程池相关配置,用于技术调优,可忽略
|
||||||
|
thread-count: 50
|
||||||
|
# 隧道SSL证书配置
|
||||||
|
key-store-password: 123456
|
||||||
|
jks-path: classpath:/test.jks
|
||||||
|
# 服务端IP
|
||||||
|
server-ip: host.docker.internal
|
||||||
|
# 服务端端口(对应服务端app.yml中的tunnel.port、tunnel.ssl-port)
|
||||||
|
server-port: 9002
|
||||||
|
# 是否启用SSL(注意:该配置必须和server-port对应上)
|
||||||
|
ssl-enable: true
|
||||||
|
# 客户端连接唯一凭证
|
||||||
|
license-key: b0a907332b474b25897c4dcb31fc7eb6
|
||||||
|
# 客户端唯一身份标识(可忽略,若不设置首次启动会自动生成)
|
||||||
|
client-id:
|
||||||
|
# 是否开启隧道传输报文日志(日志级别为debug时开启才有效)
|
||||||
|
transfer-log-enable: false
|
||||||
|
# 是否开启心跳日志
|
||||||
|
heartbeat-log-enable: false
|
||||||
|
# 重连设置
|
||||||
|
reconnection:
|
||||||
|
# 重连间隔(秒)
|
||||||
|
interval-seconds: 10
|
||||||
|
# 是否开启无限重连(未开启时,客户端license不合法会自动停止应用,开启了则不会,请谨慎开启)
|
||||||
|
unlimited: false
|
||||||
|
client:
|
||||||
|
udp:
|
||||||
|
# 线程池相关配置,用于技术调优,可忽略
|
||||||
|
boss-thread-count: 5
|
||||||
|
work-thread-count: 20
|
||||||
|
# udp傀儡端口范围
|
||||||
|
puppet-port-range: 10000-10500
|
||||||
|
# 是否开启隧道传输报文日志(日志级别为debug时开启才有效)
|
||||||
|
transfer-log-enable: false
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
version: '3.8'
|
||||||
|
|
||||||
|
networks:
|
||||||
|
npClient:
|
||||||
|
driver: bridge
|
||||||
|
services:
|
||||||
|
npClient:
|
||||||
|
image: aoshiguchen/neutrino-proxy-client:latest
|
||||||
|
container_name: compose-npClient
|
||||||
|
hostname: npClient
|
||||||
|
restart: always
|
||||||
|
environment:
|
||||||
|
TZ: Asia/Shanghai
|
||||||
|
LANG: zh_CN.UTF-8
|
||||||
|
volumes:
|
||||||
|
- ./config:/root/neutrino-proxy/config
|
||||||
|
- ./logs:/root/neutrino-proxy/logs
|
||||||
|
ports:
|
||||||
|
- "10000-10500:10000-10500/udp"
|
||||||
|
networks:
|
||||||
|
- npClient
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
server:
|
||||||
|
# 服务端web端口,用于支持HTTP接口,管理后台页面访问
|
||||||
|
port: 8888
|
||||||
|
# 日志级别
|
||||||
|
solon.logging:
|
||||||
|
logger:
|
||||||
|
"root":
|
||||||
|
level: info
|
||||||
|
appender:
|
||||||
|
file:
|
||||||
|
level: info
|
||||||
|
|
||||||
|
neutrino:
|
||||||
|
proxy:
|
||||||
|
# 隧道相关配置-用于维持服务端与客户端的通信
|
||||||
|
tunnel:
|
||||||
|
# 线程池相关配置,用于技术调优,可忽略
|
||||||
|
boss-thread-count: 2
|
||||||
|
work-thread-count: 10
|
||||||
|
# 隧道非SSL端口
|
||||||
|
port: 9000
|
||||||
|
# 隧道SSL端口
|
||||||
|
ssl-port: 9002
|
||||||
|
# 隧道SSL证书配置
|
||||||
|
key-store-password: 123456
|
||||||
|
key-manager-password: 123456
|
||||||
|
jks-path: classpath:/test.jks
|
||||||
|
# 是否开启隧道传输报文日志(日志级别为debug时开启才有效)
|
||||||
|
transfer-log-enable: false
|
||||||
|
# 是否开启心跳日志
|
||||||
|
heartbeat-log-enable: false
|
||||||
|
server:
|
||||||
|
tcp:
|
||||||
|
# 线程池相关配置,用于技术调优,可忽略
|
||||||
|
boss-thread-count: 5
|
||||||
|
work-thread-count: 20
|
||||||
|
# http代理端口,默认80(不配置不支持)
|
||||||
|
http-proxy-port: 80
|
||||||
|
# https代理端口,默认443 (不配置不支持,同时需要配置域名、证书)
|
||||||
|
https-proxy-port: 443
|
||||||
|
# 是否开启代理服务报文日志(日志级别为debug时开启才有效)
|
||||||
|
transfer-log-enable: false
|
||||||
|
udp:
|
||||||
|
# 线程池相关配置,用于技术调优,可忽略
|
||||||
|
boss-thread-count: 5
|
||||||
|
work-thread-count: 20
|
||||||
|
# 是否开启代理服务报文日志(日志级别为debug时开启才有效)
|
||||||
|
transfer-log-enable: false
|
||||||
|
data:
|
||||||
|
db:
|
||||||
|
# 数据库类型,目前支持h2、mysql、mariadb
|
||||||
|
type: h2
|
||||||
|
# 数据库连接URL
|
||||||
|
url: jdbc:h2:file:./data/db;MODE=MySQL;AUTO_SERVER=TRUE
|
||||||
|
# 数据库用户名
|
||||||
|
username:
|
||||||
|
# 数据库密码
|
||||||
|
password:
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
version: '3.8'
|
||||||
|
|
||||||
|
networks:
|
||||||
|
npServer:
|
||||||
|
driver: bridge
|
||||||
|
services:
|
||||||
|
npServer:
|
||||||
|
image: aoshiguchen/neutrino-proxy-server:latest
|
||||||
|
container_name: compose-npServer
|
||||||
|
hostname: npServer
|
||||||
|
restart: always
|
||||||
|
environment:
|
||||||
|
TZ: Asia/Shanghai
|
||||||
|
LANG: zh_CN.UTF-8
|
||||||
|
volumes:
|
||||||
|
- ./config:/root/neutrino-proxy/config
|
||||||
|
- ./data:/root/neutrino-proxy/data
|
||||||
|
- ./logs:/root/neutrino-proxy/logs
|
||||||
|
ports:
|
||||||
|
- "8888:8888"
|
||||||
|
- "9000:9000"
|
||||||
|
- "9002:9002"
|
||||||
|
- "9101-9120:9101-9120"
|
||||||
|
networks:
|
||||||
|
- npServer
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
server:
|
||||||
|
# 服务端web端口,用于支持HTTP接口,管理后台页面访问
|
||||||
|
port: 8888
|
||||||
|
# 日志级别
|
||||||
|
solon.logging:
|
||||||
|
logger:
|
||||||
|
"root":
|
||||||
|
level: info
|
||||||
|
appender:
|
||||||
|
file:
|
||||||
|
level: info
|
||||||
|
|
||||||
|
neutrino:
|
||||||
|
proxy:
|
||||||
|
# 隧道相关配置-用于维持服务端与客户端的通信
|
||||||
|
tunnel:
|
||||||
|
# 线程池相关配置,用于技术调优,可忽略
|
||||||
|
boss-thread-count: 2
|
||||||
|
work-thread-count: 10
|
||||||
|
# 隧道非SSL端口
|
||||||
|
port: 9000
|
||||||
|
# 隧道SSL端口
|
||||||
|
ssl-port: 9002
|
||||||
|
# 隧道SSL证书配置
|
||||||
|
key-store-password: 123456
|
||||||
|
key-manager-password: 123456
|
||||||
|
jks-path: classpath:/test.jks
|
||||||
|
# 是否开启隧道传输报文日志(日志级别为debug时开启才有效)
|
||||||
|
transfer-log-enable: false
|
||||||
|
# 是否开启心跳日志
|
||||||
|
heartbeat-log-enable: false
|
||||||
|
server:
|
||||||
|
tcp:
|
||||||
|
# 线程池相关配置,用于技术调优,可忽略
|
||||||
|
boss-thread-count: 5
|
||||||
|
work-thread-count: 20
|
||||||
|
# http代理端口,默认80(不配置不支持)
|
||||||
|
http-proxy-port: 80
|
||||||
|
# https代理端口,默认443 (不配置不支持,同时需要配置域名、证书)
|
||||||
|
https-proxy-port: 443
|
||||||
|
# 是否开启代理服务报文日志(日志级别为debug时开启才有效)
|
||||||
|
transfer-log-enable: false
|
||||||
|
udp:
|
||||||
|
# 线程池相关配置,用于技术调优,可忽略
|
||||||
|
boss-thread-count: 5
|
||||||
|
work-thread-count: 20
|
||||||
|
# 是否开启代理服务报文日志(日志级别为debug时开启才有效)
|
||||||
|
transfer-log-enable: false
|
||||||
|
data:
|
||||||
|
db:
|
||||||
|
# 数据库类型,目前支持h2、mysql、mariadb
|
||||||
|
type: mysql
|
||||||
|
# 数据库连接URL
|
||||||
|
url: jdbc:mysql://mysql:3306/neutrino-proxy?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&useAffectedRows=true&useSSL=false&allowPublicKeyRetrieval=true
|
||||||
|
# 数据库用户名
|
||||||
|
username: root
|
||||||
|
# 数据库密码
|
||||||
|
password: 123456
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
-- Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
-- or more contributor license agreements. See the NOTICE file
|
||||||
|
-- distributed with this work for additional information
|
||||||
|
-- regarding copyright ownership. The ASF licenses this file
|
||||||
|
-- to you under the Apache License, Version 2.0 (the
|
||||||
|
-- "License"); you may not use this file except in compliance
|
||||||
|
-- with the License. You may obtain a copy of the License at
|
||||||
|
--
|
||||||
|
-- http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
--
|
||||||
|
-- Unless required by applicable law or agreed to in writing, software
|
||||||
|
-- distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
-- See the License for the specific language governing permissions and
|
||||||
|
-- limitations under the License.
|
||||||
|
|
||||||
|
-- this file works for MySQL.
|
||||||
|
|
||||||
|
set names utf8mb4;
|
||||||
|
create database if not exists `neutrino-proxy` default charset utf8mb4 collate utf8mb4_general_ci;
|
||||||
|
commit;
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
version: '3.8'
|
||||||
|
|
||||||
|
networks:
|
||||||
|
npServer:
|
||||||
|
driver: bridge
|
||||||
|
services:
|
||||||
|
mysql:
|
||||||
|
image: mysql:8
|
||||||
|
container_name: compose-mysql
|
||||||
|
hostname: mysql
|
||||||
|
restart: always
|
||||||
|
healthcheck:
|
||||||
|
test: ['CMD-SHELL', 'mysqladmin ping -h 127.0.0.1 --silent']
|
||||||
|
interval: 3s
|
||||||
|
retries: 5
|
||||||
|
start_period: 3m
|
||||||
|
ports:
|
||||||
|
- "3308:3306"
|
||||||
|
environment:
|
||||||
|
TZ: Asia/Shanghai
|
||||||
|
MYSQL_ROOT_PASSWORD: 123456
|
||||||
|
volumes:
|
||||||
|
- ./data/mysqldata:/var/lib/mysql/
|
||||||
|
- ./config/sql:/docker-entrypoint-initdb.d/
|
||||||
|
networks:
|
||||||
|
- npServer
|
||||||
|
npServer:
|
||||||
|
image: aoshiguchen/neutrino-proxy-server:latest
|
||||||
|
container_name: compose-npServer
|
||||||
|
hostname: npServer
|
||||||
|
restart: always
|
||||||
|
environment:
|
||||||
|
TZ: Asia/Shanghai
|
||||||
|
LANG: zh_CN.UTF-8
|
||||||
|
depends_on:
|
||||||
|
mysql:
|
||||||
|
condition: service_healthy
|
||||||
|
volumes:
|
||||||
|
- ./config:/root/neutrino-proxy/config
|
||||||
|
- ./data:/root/neutrino-proxy/data
|
||||||
|
- ./logs:/root/neutrino-proxy/logs
|
||||||
|
ports:
|
||||||
|
- "8888:8888"
|
||||||
|
- "9000:9000"
|
||||||
|
- "9002:9002"
|
||||||
|
- "9101-9120:9101-9120"
|
||||||
|
networks:
|
||||||
|
- npServer
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# 镜像版本,每次更新版本时需要调整
|
# 镜像版本,每次更新版本时需要调整
|
||||||
ImageVer=2.0.0
|
ImageVer=2.0.2
|
||||||
ImageName=neutrino-proxy-client
|
ImageName=neutrino-proxy-client
|
||||||
DockerFilePath=$PWD/../../neutrino-proxy-client
|
DockerFilePath=$PWD/../../neutrino-proxy-client
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ MODULE_NAME=neutrino-proxy-client
|
|||||||
deployDir="deploy"
|
deployDir="deploy"
|
||||||
clientDeployDir=$deployDir"/client"
|
clientDeployDir=$deployDir"/client"
|
||||||
machine=macos
|
machine=macos
|
||||||
VER=2.0.1
|
VER=2.0.3
|
||||||
|
|
||||||
#切到项目根目录
|
#切到项目根目录
|
||||||
cd ../..
|
cd ../..
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# 镜像版本,每次更新版本时需要调整
|
# 镜像版本,每次更新版本时需要调整
|
||||||
ImageVer=2.0.0
|
ImageVer=2.0.2
|
||||||
ImageName=neutrino-proxy
|
ImageName=neutrino-proxy
|
||||||
DockerFilePath=$PWD/../../neutrino-proxy-server
|
DockerFilePath=$PWD/../../neutrino-proxy-server
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ MODULE_NAME=neutrino-proxy-server
|
|||||||
deployDir="deploy"
|
deployDir="deploy"
|
||||||
serverDeployDir=$deployDir"/server"
|
serverDeployDir=$deployDir"/server"
|
||||||
machine=macos
|
machine=macos
|
||||||
VER=2.0.1
|
VER=2.0.3
|
||||||
|
|
||||||
#切到项目根目录
|
#切到项目根目录
|
||||||
cd ../..
|
cd ../..
|
||||||
|
|||||||