Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7b344d6c0c | ||
|
|
4b68f1925d | ||
|
|
62dcc43444 | ||
|
|
092fe74b78 | ||
|
|
99ecdc5cd2 | ||
|
|
d64d25254e | ||
|
|
b6e76ecc74 | ||
|
|
8a37ae2d4b | ||
|
|
1be2326873 | ||
|
|
22d9bb9d39 | ||
|
|
b07b7567e2 | ||
|
|
0a70d58817 | ||
|
|
e96083e996 | ||
|
|
cbbaca8590 | ||
|
|
bb4ca4daf5 | ||
|
|
751ddd744a | ||
|
|
07da864c09 | ||
|
|
0e315b00c9 | ||
|
|
96997a1f22 | ||
|
|
cbc4b2dced | ||
|
|
79a3170234 | ||
|
|
7033627a9f | ||
|
|
3500e8fca8 | ||
|
|
215412d5d2 | ||
|
|
5665426fdb | ||
|
|
ca48d9ffda | ||
|
|
b8d1a36395 | ||
|
|
9ca5273177 | ||
|
|
3f274a7e5c | ||
|
|
14ba030efe | ||
|
|
8d0a796706 | ||
|
|
32f038b6de | ||
|
|
bf432c0f44 | ||
|
|
ef8d1b0036 | ||
|
|
57117c3dd6 | ||
|
|
d0de78ce60 | ||
|
|
00d2918e76 | ||
|
|
950f679c79 | ||
|
|
41531a2ad9 | ||
|
|
5a24ff6aa4 | ||
|
|
76129db46f | ||
|
|
e9a2c7072d | ||
|
|
221b0ca52c | ||
|
|
ed5feee43b | ||
|
|
01d67312cb | ||
|
|
2cb672e184 | ||
|
|
bb766a434a | ||
|
|
ec95da42ec | ||
|
|
4d16ea6543 | ||
|
|
0beb1c114a | ||
|
|
f717fcc63a | ||
|
|
5b57cd9173 | ||
|
|
0d4c5597b5 | ||
|
|
132353e58c | ||
|
|
8cfd4fef2c |
@@ -52,4 +52,6 @@ hs_err_pid*
|
||||
|
||||
**/app-**.yml
|
||||
|
||||
**/memo/**
|
||||
**/memo/**
|
||||
|
||||
neutrino-proxy-vuepress/deploy.sh
|
||||
@@ -103,7 +103,7 @@ proxy:
|
||||
ssl-enable: false
|
||||
```
|
||||
## 5.5、代理示意图
|
||||

|
||||

|
||||
|
||||
## 5.6、启动客户端
|
||||
### 5.6.1、启动参数直接指定配置
|
||||
@@ -180,6 +180,9 @@ neutrino.proxy.client.license-key=b0a907332b474b25897c4dcb31fc7eb6
|
||||
<a href="https://gitee.com/dearsny" target="_blank">
|
||||
<img src="assets/developer/pingon.png" width="12%">
|
||||
</a>
|
||||
<a href="https://gitee.com/ixxxk" target="_blank">
|
||||
<img src="assets/developer/tany.png" width="12%">
|
||||
</a>
|
||||
</p>
|
||||
|
||||
# ❤️ 感谢
|
||||
|
||||
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 49 KiB |
|
After Width: | Height: | Size: 258 KiB |
|
Before Width: | Height: | Size: 183 KiB After Width: | Height: | Size: 183 KiB |
|
After Width: | Height: | Size: 1.4 MiB |
@@ -0,0 +1,8 @@
|
||||
@echo off
|
||||
@rem console output code changed to UTF-8
|
||||
chcp 65001
|
||||
@rem basic params
|
||||
set MODULE_NAME="neutrino-proxy-client"
|
||||
@rem step
|
||||
cd %~dp0 && cd ../
|
||||
call mvn clean package -pl %MODULE_NAME% -am -Dmaven.test.skip=true
|
||||
@@ -0,0 +1,10 @@
|
||||
@echo off
|
||||
@rem console output code changed to UTF-8
|
||||
chcp 65001
|
||||
@rem basic params
|
||||
set MODULE_NAME="neutrino-proxy-client"
|
||||
set JAR_NAME="neutrino-proxy-client.jar"
|
||||
set JVM_OPTS="-Xmx256m" "-Xms256m"
|
||||
@rem step
|
||||
cd %~dp0 && cd ../%MODULE_NAME%/target
|
||||
java -jar %JVM_OPTS% %JAR_NAME%
|
||||
@@ -0,0 +1,8 @@
|
||||
@echo off
|
||||
@rem console output code changed to UTF-8
|
||||
chcp 65001
|
||||
@rem basic params
|
||||
set MODULE_NAME="neutrino-proxy-server"
|
||||
@rem step
|
||||
cd %~dp0 && cd ../
|
||||
call mvn clean package -pl %MODULE_NAME% -am -Dmaven.test.skip=true
|
||||
@@ -0,0 +1,10 @@
|
||||
@echo off
|
||||
@rem console output code changed to UTF-8
|
||||
chcp 65001
|
||||
@rem basic params
|
||||
set MODULE_NAME="neutrino-proxy-server"
|
||||
set JAR_NAME="neutrino-proxy-server.jar"
|
||||
set JVM_OPTS="-Xmx256m" "-Xms256m"
|
||||
@rem step
|
||||
cd %~dp0 && cd ../%MODULE_NAME%/target
|
||||
java -jar %JVM_OPTS% %JAR_NAME%
|
||||
@@ -52,3 +52,6 @@
|
||||
通过`ProxyChannel`向服务端发送`Transfer`指令,并携带响应数据。
|
||||
- 5.4、服务端通过`ProxyChannel`收到来自客户端的`Transfer`指令,找到`ProxyChannel`绑定的`VisitorChannel`,
|
||||
通过`VisitorChannel`向用户端写入响应数据。
|
||||
|
||||
# 请求流程图
|
||||

|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
# 🎋代码分支说明
|
||||
- dev:常规开发分支,日常的开发、Bug修复、提交PR都在此分支
|
||||
- feature/xxx:特征分支,一些试验性开发、提交PR都在此分支,xxx可自行取一个有意义的名称
|
||||
- release/xxx:发行版分支,作为阶段性成果、重大更新的版本固化分支。受保护,不允许任何提交。
|
||||
- master:主分支,定期同步最新代码,目前仅支持本人(傲世孤尘/雨韵诗泽)提交。
|
||||
|
||||
# ✊贡献的方式
|
||||
包括,但不限于以下形式:
|
||||
- 提交[issues](https://gitee.com/dromara/neutrino-proxy/issues)
|
||||
- 参与[issues](https://gitee.com/dromara/neutrino-proxy/issues)解决的必要性、解决方案的讨论、给出建设性的意见
|
||||
- 领取[issues](https://gitee.com/dromara/neutrino-proxy/issues) 并完成开发、提交PR
|
||||
- 为[本项目](https://gitee.com/dromara/neutrino-proxy)完善代码注释
|
||||
- 为[本项目](https://gitee.com/dromara/neutrino-proxy)增加测试代码
|
||||
- 为[本项目](https://gitee.com/dromara/neutrino-proxy)优化现有代码
|
||||
- 为[本项目](https://gitee.com/dromara/neutrino-proxy)优化操作体验
|
||||
- 通过公众号、博客、贴吧、论坛等形式分享/宣传中微子代理
|
||||
- 丰富项目文档,包括使用过程中踩过的坑、需要优化的点、具体问题的解决方法等
|
||||
|
||||
# 🧬贡献代码的步骤
|
||||
- 在Gitee上fork项目到自己的仓库
|
||||
- 将fork后的自己仓库的项目clone到本地
|
||||
- 拉取dev分支最新代码,并修改
|
||||
- commit并push到自己的仓库
|
||||
- 登录Gitee在的仓库上可以看到一个 pull request 按钮,点击它,填写一些说明信息,然后提交即可。
|
||||
- 等待合并
|
||||
|
||||
# 📐PR的规范
|
||||
> 你可能发现有的代码并不符合这个规范,但我们后续都会朝着这个方向迈进。后续我们会逐步全面规范化,请先保证新提交的代码满足以下要求:
|
||||
|
||||
- 注释完备,尤其每个新增的方法应按照Java文档规范标明方法说明、参数说明、返回值说明等信息,必要时请添加单元测试,如果愿意,也可以加上你的大名。
|
||||
- 原则上,不允许自行添加第三方依赖库。若确有必要,请先和项目负责人沟通达成一致。
|
||||
- 对现有代码的优化,请在注释中说明原因。
|
||||
- 如果涉及到数据库的变更,则至少需要做到以下绩点:
|
||||
- sqlite、mysql下均测试通过
|
||||
- 在`./neutrino-proxy-server/src/main/resource/sql`下维护更新对应的表结构sql文件
|
||||
- 对于新增的表,维护必要的初始化数据
|
||||
- 在对应的mysql、sqlite的update目录下,维护SQL变更记录,确保SQL执行测试通过
|
||||
@@ -0,0 +1,79 @@
|
||||
# 1、部署服务端
|
||||
## 1.1、Docker一键部署
|
||||
### 使用默认sqlite数据库
|
||||
```shell
|
||||
docker run -it -p 9000-9200:9000-9200/tcp -p 8888:8888 \
|
||||
-d --restart=always --name neutrino-proxy \
|
||||
registry.cn-hangzhou.aliyuncs.com/asgc/neutrino-proxy:1.7.1
|
||||
```
|
||||
|
||||
### 指定自己的mysql数据库
|
||||
- 在服务器上创建目录:/root/neutrino-proxy/config
|
||||
- 在该目录下创建`app.yml`文本文件,并配置如下内容:
|
||||
```yml
|
||||
neutrino:
|
||||
data:
|
||||
db:
|
||||
type: mysql
|
||||
# 自己的数据库实例,创建一个空的名为'neutrino-proxy'的数据库即可,首次启动服务端会自动初始化
|
||||
url: jdbc:mysql://xxxx:3306/neutrino-proxy?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&useAffectedRows=true&useSSL=false
|
||||
driver-class: com.mysql.jdbc.Driver
|
||||
# 数据库帐号
|
||||
username: xxx
|
||||
# 数据库密码
|
||||
password: wHCvf3@hmw^D*
|
||||
```
|
||||
- 然后执行如下命令:
|
||||
```shell
|
||||
docker run -it -p 9000-9200:9000-9200/tcp -p 8888:8888 \
|
||||
-v /root/neutrino-proxy/config:/root/neutrino-proxy/config \
|
||||
-d --restart=always --name neutrino \
|
||||
registry.cn-hangzhou.aliyuncs.com/asgc/neutrino-proxy:1.7.1
|
||||
```
|
||||
|
||||
## 1.2、使用jar包自行部署
|
||||
- 首先确保服务器上已安装java8运行环境
|
||||
- 打开[发行版页面](https://gitee.com/dromara/neutrino-proxy/releases),下载最新的release包:`neutrino-proxy-server.jar`、`neutrino-proxy-admin.zip`
|
||||
- 在服务器上新建部署目录:`/work/projects/neutrino-proxy-server`
|
||||
- 将` neutrino-proxy-server.jar`、`neutrino-proxy-admin.zip`上传至服务器部署目录。
|
||||
- 解压`neutrino-proxy-admin.zip`文件
|
||||
- 执行命令`java -jar neutrino-proxy-server.jar`启动服务端完成部署,默认使用sqlite数据库。
|
||||
- 若需要指定自己的mysql数据库,同样的需要在当前目录下新建`app.yml`文件,文件内容同上。执行命令`java -jar neutrino-proxy-server.jar config=app.yml`启动服务端完成部署
|
||||
- 可参照 https://gitee.com/dromara/neutrino-proxy/blob/master/bin/server_start.sh 使用shell脚本启动服务端。
|
||||
|
||||
# 2、管理后台配置
|
||||
- 服务端部署成功后,访问`http://{服务端IP}:8888`打开后台管理页面。
|
||||
- 使用默认的管理员帐号登录:admin/123456
|
||||
- 打开`代理配置>License管理`页面,可以看到系统已经自动为管理员初始化了一条License记录,复制该`LicenseKey`备用,后续客户端配置需要。
|
||||
- 打开`代理配置>端口映射`页面,可以看到系统已经自动为初始化了几条端口映射。可根据需要自行添加、修改。这里我们以`9101 -> 127.0.0.1:8080`映射为例
|
||||
|
||||
# 3、启动客户端
|
||||
- 首先确保本地已安装java8运行环境
|
||||
- 打开[发行版页面](https://gitee.com/dromara/neutrino-proxy/releases),下载最新的release包:`neutrino-proxy-client.jar`
|
||||
- 在本地`neutrino-proxy-client.jar`同级别目录下新建`app.yml`文件,并配置如下内容:
|
||||
```yml
|
||||
neutrino:
|
||||
proxy:
|
||||
client:
|
||||
# ssl证书密钥(使用jjar包内自带的证书,则此处无需修改)
|
||||
key-store-password: 123456
|
||||
# ssl证书管理密钥(使用jjar包内自带的证书,则此处无需修改。自定义证书,则此处配置对应的路径)
|
||||
jks-path: classpath:/test.jks
|
||||
# 代理服务端IP
|
||||
server-ip: localhost
|
||||
# 代理服务端IP, 若是非ssl端口,则ssl-enable需要配置为false
|
||||
server-port: 9002
|
||||
# 是否启用ssl
|
||||
ssl-enable: true
|
||||
# licenseKey,客户端凭证。此处需要配置刚刚从管理后台复制的LicenseKey
|
||||
license-key: xxxx
|
||||
```
|
||||
- 执行命令`java -jar neutrino-proxy-client.jar`启动客户端
|
||||
- 查看服务端License管理,刷新页面,对应的License在线状态为`在线`,则表明客户端已正常连接。
|
||||
|
||||
# 4、代理验证
|
||||
- 本地启动被代理服务,如:redis、本地web项目、本地mysql等等
|
||||
- 先确保本地能正常访问被代理服务,如果本地都不能访问,不用想代理更不可能!!!
|
||||
- 通过服务端IP+9101(上面License配置的端口映射重的服务端端口)访问本地被代理服务
|
||||
|
||||
访问成功,至此首次完整的内网穿透体验完成。开源不易,请速至[Gitee仓库](https://gitee.com/dromara/neutrino-proxy)一键三连🤝
|
||||
@@ -0,0 +1,30 @@
|
||||
# 首页
|
||||
- License统计:统计License相关数量指标
|
||||
- 端口映射统计:统计端口映射相关数量指标
|
||||
- 今日流量:统计当天的服务端上行/下行流量数据
|
||||
- 流量汇总:统计所有(包含当天)的服务端上行/下行流量数据
|
||||
- 流量监控:按天统计最近15天(可能会动态调整)每天的上行流量、下行流量、汇总流量
|
||||
|
||||
# 代理配置
|
||||
- License管理:License是客户端连接服务端的唯一合法凭证。一个License同时只能被一个客户端使用,一个License可以维护多条端口映射
|
||||
- 端口映射:服务端IP+端口 -> 客户端IP+端口的四元组映射(因目前服务端单节点只有一个公网IP,所以不体现出来),是内网穿透的基本单元。
|
||||
|
||||
# 系统管理
|
||||
- 用户管理:支持多用户,一个用户可持有多个License。由于项目目前主推个人版,所以暂是没有权限这一套,管理员之外的所有用户都属于游客。对于绝大多数操作,游客仅有只读权限。
|
||||
- 端口池管理:用于统一管理服务器内网穿透端口,方便统一设置安全组。
|
||||
- 端口池分组:对端口池的一个分组。
|
||||
- 全局分组:该分组下的端口全局通用。
|
||||
- 用户分组:该分组下的端口由分组绑定的用户独占。
|
||||
- License分组:该分组下的端口由分组绑定的License独占。
|
||||
- 调度管理:维护服务端定时任务。方便开发、调试。正常使用时无需关心。
|
||||
|
||||
# 报表管理
|
||||
- 用户流量报表:基于用户维度的流量统计
|
||||
- License流量报表:基于License的流量统计
|
||||
- 用户流量月度明细:基于用户的流量月度统计
|
||||
- License流量月度明细:基于License的流量月度统计
|
||||
|
||||
# 日志管理
|
||||
- 调度日志:服务端定时任务执行日志
|
||||
- 登录日志:管理后端登录、退出登录的日志
|
||||
- 客户端连接日志:客户端连接、断开的日志
|
||||
@@ -40,7 +40,8 @@ module.exports = {
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
...(config.dev.useEslint ? [createLintingRule()] : []),
|
||||
// 关闭EsLint校验
|
||||
// ...(config.dev.useEslint ? [createLintingRule()] : []),
|
||||
{
|
||||
test: /\.vue$/,
|
||||
loader: 'vue-loader',
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
module.exports = {
|
||||
NODE_ENV: '"development"',
|
||||
ENV_CONFIG: '"dev"',
|
||||
BASE_API: '"http://103.163.47.16:8888"'
|
||||
BASE_API: '"http://103.163.47.16:8888"',
|
||||
USER_NAME: '"visitor"',
|
||||
USER_PWD: '"123456"'
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function domainNameBindInfo(query) {
|
||||
return request({
|
||||
url: '/domain-name/bind-info',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function fetchList(query) {
|
||||
return request({
|
||||
url: '/protocal/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function protocalList(query) {
|
||||
return request({
|
||||
url: '/protocal/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
@@ -102,7 +102,8 @@ export default {
|
||||
draft: 'Draft',
|
||||
delete: 'Delete',
|
||||
cancel: 'Cancel',
|
||||
confirm: 'Confirm'
|
||||
confirm: 'Confirm',
|
||||
portOrRange: 'example: 3306 or 1000-2000'
|
||||
},
|
||||
errorLog: {
|
||||
tips: 'Please click the bug icon in the upper right corner',
|
||||
|
||||
@@ -49,6 +49,7 @@ export default {
|
||||
system: '系统管理',
|
||||
portPool: '端口池管理',
|
||||
portGroup: '端口分组管理',
|
||||
protocal: '协议管理',
|
||||
proxy: '代理配置',
|
||||
license: 'License管理',
|
||||
portMapping: '端口映射',
|
||||
@@ -136,6 +137,7 @@ export default {
|
||||
enable: '启用',
|
||||
loginName: '登录名',
|
||||
port: '端口',
|
||||
portOrRange: '端口或范围,如: 3306或1000-2000',
|
||||
licenseName: 'License名称',
|
||||
licenseKey: 'License Key',
|
||||
isOnline: '在线状态',
|
||||
@@ -161,7 +163,10 @@ export default {
|
||||
resetKey: '重置Key',
|
||||
upFlow: '上行流量',
|
||||
downFlow: '下行流量',
|
||||
totalFlow: '总流量'
|
||||
totalFlow: '总流量',
|
||||
protocalName: '协议',
|
||||
supportStatus: '支持状态',
|
||||
domainName: '域名'
|
||||
},
|
||||
button: {
|
||||
lookOver: '查看'
|
||||
|
||||
@@ -77,6 +77,7 @@ export const asyncRouterMap = [
|
||||
{ path: 'user', component: _import('system/user'), name: 'user', meta: { title: 'user' }},
|
||||
{ path: 'portGroup', component: _import('system/portGroup'), name: 'portGroup', meta: { title: 'portGroup' }},
|
||||
{ path: 'portPool', component: _import('system/portPool'), name: 'portPool', meta: { title: 'portPool' }},
|
||||
{ path: 'protocal', component: _import('system/protocal'), name: 'protocal', meta: { title: 'protocal' }},
|
||||
{ path: 'jobManager', component: _import('system/jobManager'), name: 'jobManager', meta: { title: 'jobManager' }}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
<script>
|
||||
import echarts from 'echarts'
|
||||
require('echarts/theme/macarons') // echarts theme
|
||||
let that = null
|
||||
|
||||
export default {
|
||||
props: {
|
||||
@@ -42,7 +41,6 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
that = this
|
||||
this.initChart()
|
||||
},
|
||||
beforeDestroy() {
|
||||
@@ -68,8 +66,8 @@ export default {
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'item',
|
||||
formatter: function(value) {
|
||||
return `${value.seriesName} <br/>${value.marker} : ${value.name} ${value.name === '上行' ? that.data.upFlowDesc : that.data.downFlowDesc}`
|
||||
formatter: (value) => {
|
||||
return `${value.seriesName} <br/>${value.marker} : ${value.name} ${value.name === '上行' ? this.data.upFlowDesc : this.data.downFlowDesc}`
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
|
||||
@@ -6,8 +6,6 @@
|
||||
import echarts from 'echarts'
|
||||
require('echarts/theme/macarons') // echarts theme
|
||||
import { getSizeDescByByteCount } from '@/utils/utils'
|
||||
let that = null
|
||||
|
||||
export default {
|
||||
props: {
|
||||
chartId: {
|
||||
@@ -38,7 +36,6 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
that = this
|
||||
this.initChart()
|
||||
},
|
||||
beforeDestroy() {
|
||||
@@ -87,10 +84,10 @@ export default {
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
formatter: function(value) {
|
||||
let title = that.data.text + '<br/>'
|
||||
formatter: (value) => {
|
||||
let title = this.data.text + '<br/>'
|
||||
value.forEach(item => {
|
||||
title = title + item.marker + item.seriesName + ' : ' + that.data.list[item.seriesIndex].label[item.dataIndex] + '<br/>'
|
||||
title = title + item.marker + item.seriesName + ' : ' + this.data.list[item.seriesIndex].label[item.dataIndex] + '<br/>'
|
||||
})
|
||||
return title
|
||||
}
|
||||
@@ -113,7 +110,7 @@ export default {
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
axisLabel: {
|
||||
formatter: function(value) {
|
||||
formatter: (value) => {
|
||||
return getSizeDescByByteCount(value)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,9 +27,9 @@
|
||||
|
||||
<el-button type="primary" style="width:100%;margin-bottom:30px;" :loading="loading" @click.native.prevent="handleLogin">{{$t('login.logIn')}}</el-button>
|
||||
|
||||
<div class="tips">
|
||||
<span>{{$t('login.username')}} : visitor</span>
|
||||
<span>{{$t('login.password')}} : 123456</span>
|
||||
<div class="tips" v-if="user_name && user_pwd">
|
||||
<span>{{$t('login.username')}} : {{ user_name }}</span>
|
||||
<span>{{$t('login.password')}} : {{ user_pwd }}</span>
|
||||
</div>
|
||||
|
||||
</el-form>
|
||||
@@ -60,8 +60,8 @@ export default {
|
||||
}
|
||||
return {
|
||||
loginForm: {
|
||||
username: 'visitor',
|
||||
password: '123456'
|
||||
username: '',
|
||||
password: ''
|
||||
},
|
||||
loginRules: {
|
||||
username: [{ required: true, trigger: 'blur', validator: validateUsername }],
|
||||
@@ -69,7 +69,9 @@ export default {
|
||||
},
|
||||
passwordType: 'password',
|
||||
loading: false,
|
||||
showDialog: false
|
||||
showDialog: false,
|
||||
user_name: undefined,
|
||||
user_pwd: undefined
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -115,6 +117,14 @@ export default {
|
||||
// }
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (process.env.USER_NAME) {
|
||||
this.user_name = process.env.USER_NAME
|
||||
this.user_pwd = process.env.USER_PWD
|
||||
this.loginForm.username = process.env.USER_NAME
|
||||
this.loginForm.password = process.env.USER_PWD
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// window.addEventListener('hashchange', this.afterQRScan)
|
||||
},
|
||||
|
||||
@@ -7,6 +7,9 @@
|
||||
<el-select v-model="listQuery.licenseId" placeholder="请选择license" clearable style="margin-right:10px">
|
||||
<el-option v-for="item in licenseList" :key="item.key" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
<el-select v-model="listQuery.protocal" placeholder="请选择协议" clearable style="margin-right:10px">
|
||||
<el-option v-for="item in protocalList" :key="item.name" :label="item.name" :value="item.name" :disabled="!item.enable"/>
|
||||
</el-select>
|
||||
<el-input v-model="listQuery.serverPort" type="text" style="width:150px;margin-right:10px" class="filter-item"
|
||||
placeholder="请输入服务端端口" :maxlength="5" show-word-limit />
|
||||
<el-select v-model="listQuery.isOnline" placeholder="请选择在线状态" clearable style="width:145px;margin-right:10px">
|
||||
@@ -33,17 +36,27 @@
|
||||
<span>{{ scope.row.userName }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" :label="$t('table.licenseName')" width="150">
|
||||
<el-table-column align="center" :label="$t('table.licenseName')" width="130">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.licenseName }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" :label="$t('table.serverPort')" width="200">
|
||||
<el-table-column align="center" :label="$t('table.protocalName')" width="100">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.protocal }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" :label="$t('table.domainName')" width="200">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.domain }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" :label="$t('table.serverPort')" width="80">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.serverPort }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" :label="$t('table.proxyClient')" width="200">
|
||||
<el-table-column align="center" :label="$t('table.proxyClient')" width="120">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.clientIp }}:{{ scope.row.clientPort }}</span>
|
||||
</template>
|
||||
@@ -113,6 +126,12 @@
|
||||
style="width: 280px"
|
||||
/>-->
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('协议')" prop="protocal">
|
||||
<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" :disabled="!item.enable">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('服务端端口')" prop="serverPort">
|
||||
<el-select style="width: 280px;" class="filter-item" v-model="temp.serverPort" placeholder="请选择">
|
||||
<el-option v-for="item in serverPortList" :key="item.port" :label="item.port" :value="item.port">
|
||||
@@ -125,6 +144,11 @@
|
||||
<el-form-item :label="$t('客户端端口')" prop="clientPort">
|
||||
<el-input v-model="temp.clientPort"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('域名')" prop="subdomain" v-if="temp.protocal === 'HTTP'">
|
||||
<el-input v-model="temp.subdomain">
|
||||
<template slot="append">.{{domainName}}</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="
|
||||
@@ -152,7 +176,9 @@
|
||||
import { fetchList, createUserPortMapping, updateUserPortMapping, updateEnableStatus, deletePortMapping } from '@/api/portMapping'
|
||||
import { portPoolList, availablePortList } from '@/api/portPool'
|
||||
import { licenseList, licenseAuthList } from '@/api/license'
|
||||
import { protocalList } from '@/api/protocal'
|
||||
import { userList } from '@/api/user'
|
||||
import { domainNameBindInfo } from '@/api/domain'
|
||||
import waves from '@/directive/waves' // 水波纹指令
|
||||
import { parseTime } from '@/utils'
|
||||
import ButtonPopover from '../../components/Button/buttonPopover'
|
||||
@@ -205,8 +231,10 @@ export default {
|
||||
statusOptions: ['published', 'draft', 'deleted'],
|
||||
userList: [],
|
||||
licenseList: [],
|
||||
protocalList: [],
|
||||
licenseAuthList: [],
|
||||
serverPortList: [],
|
||||
domainName: '',
|
||||
showReviewer: false,
|
||||
temp: {
|
||||
id: undefined,
|
||||
@@ -214,7 +242,8 @@ export default {
|
||||
licenseName: undefined,
|
||||
serverPort: undefined,
|
||||
clientIp: undefined,
|
||||
clientPort: undefined
|
||||
clientPort: undefined,
|
||||
protocal: undefined
|
||||
},
|
||||
selectObj: {
|
||||
statusOptions: [{ label: '启用', value: 1 }, { label: '禁用', value: 2 }],
|
||||
@@ -268,9 +297,11 @@ export default {
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getDomainNameBindInfo()
|
||||
this.getDataList()
|
||||
this.getLicenseList()
|
||||
this.getLicenseAuthList()
|
||||
this.getProtocalList()
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
@@ -292,6 +323,11 @@ export default {
|
||||
this.getList()
|
||||
})
|
||||
},
|
||||
getDomainNameBindInfo() {
|
||||
domainNameBindInfo().then(response => {
|
||||
this.domainName = response.data.data
|
||||
})
|
||||
},
|
||||
getPortPoolList() {
|
||||
portPoolList().then(response => {
|
||||
this.serverPortList = response.data.data
|
||||
@@ -312,6 +348,11 @@ export default {
|
||||
this.licenseList = response.data.data
|
||||
})
|
||||
},
|
||||
getProtocalList() {
|
||||
protocalList().then(response => {
|
||||
this.protocalList = response.data.data
|
||||
})
|
||||
},
|
||||
getLicenseAuthList() {
|
||||
licenseAuthList().then(response => {
|
||||
this.licenseAuthList = response.data.data
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
<el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible">
|
||||
<el-form :rules="rules" ref="dataForm" :model="temp" label-position="left" label-width="70px" style='width: 400px; margin-left:50px;'>
|
||||
<el-form-item :label="$t('table.port')" prop="port">
|
||||
<el-input v-model="temp.port" :disabled="dialogStatus=='update'"></el-input>
|
||||
<el-input :placeholder="$t('table.portOrRange')" v-model="temp.port" :disabled="dialogStatus=='update'"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item :label="$t('table.group')" prop="group">
|
||||
@@ -92,13 +92,13 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { fetchList, updateEnableStatus, createPortPool, deletePortPool, updatePortPool } from '@/api/portPool'
|
||||
import { portGroupList } from '@/api/portGroup'
|
||||
import waves from '@/directive/waves' // 水波纹指令
|
||||
import { parseTime } from '@/utils'
|
||||
import ButtonPopover from '../../components/Button/buttonPopover'
|
||||
import { createPortPool, deletePortPool, fetchList, updateEnableStatus, updatePortPool } from '@/api/portPool'
|
||||
import { portGroupList } from '@/api/portGroup'
|
||||
import waves from '@/directive/waves' // 水波纹指令
|
||||
import { parseTime } from '@/utils'
|
||||
import ButtonPopover from '../../components/Button/buttonPopover'
|
||||
|
||||
const calendarTypeOptions = [
|
||||
const calendarTypeOptions = [
|
||||
{ key: 'CN', display_name: 'China' },
|
||||
{ key: 'US', display_name: 'USA' },
|
||||
{ key: 'JP', display_name: 'Japan' },
|
||||
|
||||
@@ -0,0 +1,169 @@
|
||||
<template>
|
||||
<div class="app-container calendar-list-container">
|
||||
<div class="filter-container">
|
||||
<el-button class="filter-item" type="primary" v-waves icon="el-icon-search" @click="handleFilter">
|
||||
{{ $t('table.search') }}
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
<el-table :key='tableKey' :data="list" v-loading="listLoading" element-loading-text="给我一点时间" border fit
|
||||
highlight-current-row
|
||||
style="width: 100%">
|
||||
<el-table-column align="center" :label="$t('table.protocalName')" width="150">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.name }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column class-name="status-col" :label="$t('table.supportStatus')" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="scope.row.enable | statusFilter">{{scope.row.enable | statusName}}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="left" :label="$t('table.remark')" width="500">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.remark }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<div class="pagination-container">
|
||||
<el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange"
|
||||
:current-pageInfo.sync="listQuery.current"
|
||||
:pageInfo-sizes="[10,20,30, 50]" :pageInfo-size="listQuery.size"
|
||||
layout="total, sizes, prev, pager, next, jumper" :total="total">
|
||||
</el-pagination>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { fetchList } from '@/api/protocal'
|
||||
import waves from '@/directive/waves' // 水波纹指令
|
||||
import { parseTime } from '@/utils'
|
||||
import ButtonPopover from '../../components/Button/buttonPopover'
|
||||
|
||||
const calendarTypeOptions = [
|
||||
{ key: 'CN', display_name: 'China' },
|
||||
{ key: 'US', display_name: 'USA' },
|
||||
{ key: 'JP', display_name: 'Japan' },
|
||||
{ key: 'EU', display_name: 'Eurozone' }
|
||||
]
|
||||
|
||||
// arr to obj ,such as { CN : "China", US : "USA" }
|
||||
const calendarTypeKeyValue = calendarTypeOptions.reduce((acc, cur) => {
|
||||
acc[cur.key] = cur.display_name
|
||||
return acc
|
||||
}, {})
|
||||
|
||||
export default {
|
||||
name: 'complexTable',
|
||||
directives: {
|
||||
waves
|
||||
},
|
||||
components: {
|
||||
ButtonPopover
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tableKey: 0,
|
||||
list: null,
|
||||
total: null,
|
||||
listLoading: true,
|
||||
listQuery: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
importance: undefined,
|
||||
title: undefined,
|
||||
type: undefined
|
||||
},
|
||||
importanceOptions: [1, 2, 3],
|
||||
calendarTypeOptions,
|
||||
sortOptions: [{ label: 'ID Ascending', key: '+id' }, { label: 'ID Descending', key: '-id' }],
|
||||
statusOptions: ['published', 'draft', 'deleted'],
|
||||
showReviewer: false,
|
||||
possessorTypeList: [
|
||||
{
|
||||
'id': 1,
|
||||
'name': '用户'
|
||||
},
|
||||
{
|
||||
'id': 2,
|
||||
'name': '通道'
|
||||
}
|
||||
],
|
||||
temp: {
|
||||
name: '',
|
||||
possessorType: 1,
|
||||
possessorId: 1
|
||||
|
||||
},
|
||||
dialogFormVisible: false,
|
||||
dialogStatus: '',
|
||||
textMap: {
|
||||
update: '编辑',
|
||||
create: '新建'
|
||||
},
|
||||
dialogPvVisible: false,
|
||||
pvData: [],
|
||||
rules: {
|
||||
port: [{ required: true, message: '端口必填', trigger: 'blur' }]
|
||||
},
|
||||
downloadLoading: false
|
||||
}
|
||||
},
|
||||
filters: {
|
||||
statusName(status) {
|
||||
const statusMap = {
|
||||
true: '支持',
|
||||
false: '不支持'
|
||||
}
|
||||
return statusMap[status]
|
||||
},
|
||||
statusFilter(status) {
|
||||
const statusMap = {
|
||||
true: 'success',
|
||||
false: 'danger'
|
||||
}
|
||||
return statusMap[status]
|
||||
},
|
||||
typeFilter(type) {
|
||||
return calendarTypeKeyValue[type]
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.listLoading = true
|
||||
fetchList(this.listQuery).then(response => {
|
||||
this.list = response.data.data.records
|
||||
this.total = response.data.data.total
|
||||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
handleFilter() {
|
||||
this.listQuery.current = 1
|
||||
this.getList()
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
this.listQuery.size = val
|
||||
this.getList()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.listQuery.current = val
|
||||
this.getList()
|
||||
},
|
||||
formatJson(filterVal, jsonData) {
|
||||
return jsonData.map(v => filterVal.map(j => {
|
||||
if (j === 'timestamp') {
|
||||
return parseTime(v[j])
|
||||
} else {
|
||||
return v[j]
|
||||
}
|
||||
}))
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -3,8 +3,8 @@
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>neutrino-proxy</artifactId>
|
||||
<groupId>fun.asgc.neutrino</groupId>
|
||||
<artifactId>neutrino-proxy-parent</artifactId>
|
||||
<groupId>org.dromara.neutrino-proxy</groupId>
|
||||
<version>${revision}</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
@@ -14,13 +14,8 @@
|
||||
<artifactId>neutrino-proxy-client</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>fun.asgc.neutrino</groupId>-->
|
||||
<!-- <artifactId>neutrino-core</artifactId>-->
|
||||
<!-- <version>${revision}</version>-->
|
||||
<!-- </dependency>-->
|
||||
<dependency>
|
||||
<groupId>fun.asgc.neutrino</groupId>
|
||||
<groupId>org.dromara.neutrino-proxy</groupId>
|
||||
<artifactId>neutrino-proxy-core</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
@@ -30,27 +25,8 @@
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<!-- <build>-->
|
||||
<!-- <finalName>${artifactId}</finalName>-->
|
||||
<!-- <plugins>-->
|
||||
<!-- <plugin>-->
|
||||
<!-- <groupId>org.springframework.boot</groupId>-->
|
||||
<!-- <artifactId>spring-boot-maven-plugin</artifactId>-->
|
||||
<!-- <version>2.1.3.RELEASE</version>-->
|
||||
<!-- <configuration>-->
|
||||
<!-- <mainClass>fun.asgc.neutrino.proxy.client.ProxyClient</mainClass>-->
|
||||
<!-- </configuration>-->
|
||||
<!-- <executions>-->
|
||||
<!-- <execution>-->
|
||||
<!-- <goals>-->
|
||||
<!-- <goal>repackage</goal>-->
|
||||
<!-- </goals>-->
|
||||
<!-- </execution>-->
|
||||
<!-- </executions>-->
|
||||
<!-- </plugin>-->
|
||||
<!-- </plugins>-->
|
||||
<!-- </build>-->
|
||||
<build>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>${project.basedir}/src/main/resources</directory>
|
||||
@@ -62,30 +38,10 @@
|
||||
</resource>
|
||||
</resources>
|
||||
<plugins>
|
||||
<!-- 配置打包插件(并打包成胖包) -->
|
||||
<plugin>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<configuration>
|
||||
<appendAssemblyId>false</appendAssemblyId>
|
||||
<finalName>${artifactId}</finalName>
|
||||
<archive>
|
||||
<manifest>
|
||||
<!--这里指定要运行的main类-->
|
||||
<mainClass>fun.asgc.neutrino.proxy.client.ProxyClient</mainClass>
|
||||
</manifest>
|
||||
</archive>
|
||||
<descriptorRefs>
|
||||
<descriptorRef>jar-with-dependencies</descriptorRef>
|
||||
</descriptorRefs>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>make-assembly</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<groupId>org.noear</groupId>
|
||||
<artifactId>solon-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
///**
|
||||
// * 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 fun.asgc.neutrino.proxy.client.core;
|
||||
//
|
||||
//import fun.asgc.neutrino.core.annotation.Autowired;
|
||||
//import fun.asgc.neutrino.core.annotation.Component;
|
||||
//import fun.asgc.neutrino.core.annotation.NonIntercept;
|
||||
//import fun.asgc.neutrino.core.annotation.Subscribe;
|
||||
//import fun.asgc.neutrino.core.base.event.ApplicationEvent;
|
||||
//import fun.asgc.neutrino.core.base.event.ApplicationEventReceiver;
|
||||
//import fun.asgc.neutrino.core.constant.AppLifeCycleStatusEnum;
|
||||
//import fun.asgc.neutrino.core.constant.MetaDataConstant;
|
||||
//import lombok.extern.slf4j.Slf4j;
|
||||
//
|
||||
///**
|
||||
// * 应用生命周期事件监听器
|
||||
// * @author: aoshiguchen
|
||||
// * @date: 2022/10/10
|
||||
// */
|
||||
//@Slf4j
|
||||
//@NonIntercept
|
||||
//@Component
|
||||
//@Subscribe(topic = MetaDataConstant.TOPIC_APP_LIFE_CYCLE)
|
||||
//public class ApplicationLifeCycleListener extends ApplicationEventReceiver<AppLifeCycleStatusEnum> {
|
||||
// @Autowired
|
||||
// private LicenseObtainService licenseObtainService;
|
||||
//
|
||||
// @Override
|
||||
// public void receive(ApplicationEvent<AppLifeCycleStatusEnum> msg) {
|
||||
// log.debug("ApplicationLifeCycleListener:{}", msg.data().getDesc());
|
||||
// if (msg.data() == AppLifeCycleStatusEnum.APP_STARTUP) {
|
||||
// licenseObtainService.start();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
//}
|
||||
@@ -1,166 +0,0 @@
|
||||
///**
|
||||
// * 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 fun.asgc.neutrino.proxy.client.core;
|
||||
//
|
||||
//import com.alibaba.fastjson.JSONObject;
|
||||
//import fun.asgc.neutrino.core.base.CustomThreadFactory;
|
||||
//import fun.asgc.neutrino.core.util.ArrayUtil;
|
||||
//import fun.asgc.neutrino.core.util.FileUtil;
|
||||
//import fun.asgc.neutrino.core.util.StringUtil;
|
||||
//import fun.asgc.neutrino.proxy.client.config.CustomConfig;
|
||||
//import fun.asgc.neutrino.proxy.client.config.ProxyConfig;
|
||||
//import lombok.extern.slf4j.Slf4j;
|
||||
//import org.noear.solon.annotation.Component;
|
||||
//import org.noear.solon.annotation.Inject;
|
||||
//
|
||||
//import java.util.HashMap;
|
||||
//import java.util.Map;
|
||||
//import java.util.Scanner;
|
||||
//import java.util.concurrent.Executors;
|
||||
//import java.util.concurrent.ScheduledExecutorService;
|
||||
//import java.util.concurrent.TimeUnit;
|
||||
//import java.util.concurrent.locks.ReentrantLock;
|
||||
//
|
||||
///**
|
||||
// * license获取服务
|
||||
// * @author: aoshiguchen
|
||||
// * @date: 2022/9/4
|
||||
// */
|
||||
//@Slf4j
|
||||
//@Component
|
||||
//public class LicenseObtainService {
|
||||
// /**
|
||||
// * 调度器
|
||||
// */
|
||||
// private static final ScheduledExecutorService scheduledExecutor = Executors.newSingleThreadScheduledExecutor(new CustomThreadFactory("LicenseObtain"));
|
||||
// private ReentrantLock runLock = new ReentrantLock();
|
||||
// private Scanner scanner = new Scanner(System.in);
|
||||
// @Inject
|
||||
// private ProxyConfig proxyConfig;
|
||||
// @Inject
|
||||
// private ProxyClientService proxyClientService;
|
||||
//
|
||||
// public void start() {
|
||||
// scheduledExecutor.scheduleWithFixedDelay(() -> {
|
||||
// boolean lock = runLock.tryLock();
|
||||
// try {
|
||||
// if (lock) {
|
||||
// this.process();
|
||||
// }
|
||||
// } finally {
|
||||
// if (runLock.isHeldByCurrentThread()){
|
||||
// runLock.unlock();
|
||||
// }
|
||||
// }
|
||||
// }, 0, proxyConfig.getClient().getObtainLicenseInterval(), TimeUnit.SECONDS);
|
||||
// }
|
||||
//
|
||||
// public void stop() {
|
||||
// scheduledExecutor.shutdown();
|
||||
// log.info("licenseKey获取任务停止");
|
||||
// }
|
||||
//
|
||||
// public void process() {
|
||||
//
|
||||
//
|
||||
// proxyClientService.start();
|
||||
// }
|
||||
//
|
||||
// private String
|
||||
//
|
||||
// private CustomConfig getCustomConfigByCliParams() {
|
||||
// CustomConfig customConfig = new CustomConfig();
|
||||
// // 默认无需输入
|
||||
// customConfig.setJksPath(environment.getMainArgsForString("jksPath", proxyConfig.getClient().getJksPath()));
|
||||
// customConfig.setServerIp(environment.getMainArgsForString("serverIp", proxyConfig.getClient().getServerIp()));
|
||||
// customConfig.setServerPort(environment.getMainArgsForInteger("serverPort", proxyConfig.getClient().getServerPort()));
|
||||
// customConfig.setSslEnable(environment.getMainArgsForBoolean("sslEnable", proxyConfig.getClient().getSslEnable()));
|
||||
// customConfig.setLicenseKey(environment.getMainArgsForString("licenseKey"));
|
||||
// // 启动参数指定了license,则无需后续处理
|
||||
// if (StringUtil.notEmpty(customConfig.getLicenseKey())) {
|
||||
//// FileUtil.write("./.neutrino-proxy-client.json", JSONObject.toJSONString(customConfig, SerializerFeature.PrettyFormat));
|
||||
// return customConfig;
|
||||
// }
|
||||
//
|
||||
// // 启动参数未指定license,则优先读取外部配置
|
||||
// String config = FileUtil.readContentAsString("./.neutrino-proxy-client.json");
|
||||
// if (StringUtil.notEmpty(config)) {
|
||||
// try {
|
||||
// CustomConfig tmp = JSONObject.parseObject(config, CustomConfig.class);
|
||||
// if (!StringUtil.isEmpty(tmp.getJksPath())) {
|
||||
// customConfig.setJksPath(tmp.getJksPath());
|
||||
// }
|
||||
// if (!StringUtil.isEmpty(tmp.getServerIp())) {
|
||||
// customConfig.setServerIp(tmp.getServerIp());
|
||||
// }
|
||||
// if (null != tmp.getServerPort()) {
|
||||
// customConfig.setServerPort(tmp.getServerPort());
|
||||
// }
|
||||
// if (null != tmp.getSslEnable()) {
|
||||
// customConfig.setSslEnable(tmp.getSslEnable());
|
||||
// }
|
||||
// if (!StringUtil.isEmpty(tmp.getLicenseKey())) {
|
||||
// customConfig.setLicenseKey(tmp.getLicenseKey());
|
||||
// }
|
||||
// } catch (Exception e) {
|
||||
// log.error("file '.neutrino-proxy-client.json' config exception!", e);
|
||||
// }
|
||||
// if (StringUtil.notEmpty(customConfig.getLicenseKey())) {
|
||||
//// FileUtil.write("./.neutrino-proxy-client.json", JSONObject.toJSONString(customConfig, SerializerFeature.PrettyFormat));
|
||||
// return customConfig;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// String license = "";
|
||||
// while (StringUtil.isEmpty(license)) {
|
||||
// System.out.print("Please input license:");
|
||||
// license = scanner.next();
|
||||
// }
|
||||
// customConfig.setLicenseKey(license);
|
||||
//// FileUtil.write("./.neutrino-proxy-client.json", JSONObject.toJSONString(customConfig, SerializerFeature.PrettyFormat));
|
||||
//
|
||||
// return customConfig;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 获取命令行参数
|
||||
// * @param args
|
||||
// * @return
|
||||
// */
|
||||
// private Map<String, String> getCliParams(String[] args) {
|
||||
// Map<String, String> res = new HashMap<>();
|
||||
// if (ArrayUtil.notEmpty(args)) {
|
||||
// for (String item : args) {
|
||||
// if (StringUtil.isEmpty(item) || !item.contains("=")) {
|
||||
// continue;
|
||||
// }
|
||||
// int index = item.indexOf("=");
|
||||
// if (index <= 0 || index == item.length() - 1) {
|
||||
// continue;
|
||||
// }
|
||||
// res.put(item.substring(0, index), item.substring(index + 1));
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return res;
|
||||
// }
|
||||
//}
|
||||
@@ -1,8 +1,7 @@
|
||||
package fun.asgc.neutrino.proxy.client;
|
||||
package org.dromara.neutrinoproxy.client;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import org.noear.solon.Solon;
|
||||
import org.noear.solon.SolonApp;
|
||||
import org.noear.solon.annotation.SolonMain;
|
||||
|
||||
/**
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.client.config;
|
||||
package org.dromara.neutrinoproxy.client.config;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package fun.asgc.neutrino.proxy.client.config;
|
||||
package org.dromara.neutrinoproxy.client.config;
|
||||
|
||||
import lombok.Data;
|
||||
import org.noear.solon.annotation.Component;
|
||||
@@ -1,13 +1,12 @@
|
||||
package fun.asgc.neutrino.proxy.client.config;
|
||||
package org.dromara.neutrinoproxy.client.config;
|
||||
|
||||
import fun.asgc.neutrino.proxy.core.ProxyDataTypeEnum;
|
||||
import fun.asgc.neutrino.proxy.core.ProxyMessage;
|
||||
import fun.asgc.neutrino.proxy.core.ProxyMessageHandler;
|
||||
import fun.asgc.neutrino.proxy.core.dispatcher.DefaultDispatcher;
|
||||
import fun.asgc.neutrino.proxy.core.dispatcher.Dispatcher;
|
||||
import org.dromara.neutrinoproxy.core.ProxyDataTypeEnum;
|
||||
import org.dromara.neutrinoproxy.core.ProxyMessage;
|
||||
import org.dromara.neutrinoproxy.core.ProxyMessageHandler;
|
||||
import org.dromara.neutrinoproxy.core.dispatcher.DefaultDispatcher;
|
||||
import org.dromara.neutrinoproxy.core.dispatcher.Dispatcher;
|
||||
import io.netty.bootstrap.Bootstrap;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.channel.nio.NioEventLoopGroup;
|
||||
import org.noear.solon.Solon;
|
||||
import org.noear.solon.annotation.Bean;
|
||||
import org.noear.solon.annotation.Configuration;
|
||||
@@ -1,9 +1,9 @@
|
||||
package fun.asgc.neutrino.proxy.client.core;
|
||||
package org.dromara.neutrinoproxy.client.core;
|
||||
|
||||
import fun.asgc.neutrino.proxy.client.util.ProxyUtil;
|
||||
import fun.asgc.neutrino.proxy.core.Constants;
|
||||
import fun.asgc.neutrino.proxy.core.ProxyMessage;
|
||||
import fun.asgc.neutrino.proxy.core.dispatcher.Dispatcher;
|
||||
import org.dromara.neutrinoproxy.client.util.ProxyUtil;
|
||||
import org.dromara.neutrinoproxy.core.Constants;
|
||||
import org.dromara.neutrinoproxy.core.ProxyMessage;
|
||||
import org.dromara.neutrinoproxy.core.dispatcher.Dispatcher;
|
||||
import io.netty.channel.Channel;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.channel.ChannelOption;
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.client.core;
|
||||
package org.dromara.neutrinoproxy.client.core;
|
||||
|
||||
import java.util.concurrent.ThreadFactory;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
@@ -20,7 +20,7 @@
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package fun.asgc.neutrino.proxy.client.core;
|
||||
package org.dromara.neutrinoproxy.client.core;
|
||||
|
||||
import io.netty.channel.Channel;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package fun.asgc.neutrino.proxy.client.core;
|
||||
package org.dromara.neutrinoproxy.client.core;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import fun.asgc.neutrino.proxy.client.config.ProxyConfig;
|
||||
import fun.asgc.neutrino.proxy.client.util.ProxyUtil;
|
||||
import fun.asgc.neutrino.proxy.core.ProxyMessage;
|
||||
import fun.asgc.neutrino.proxy.core.ProxyMessageDecoder;
|
||||
import fun.asgc.neutrino.proxy.core.ProxyMessageEncoder;
|
||||
import fun.asgc.neutrino.proxy.core.util.FileUtil;
|
||||
import org.dromara.neutrinoproxy.client.config.ProxyConfig;
|
||||
import org.dromara.neutrinoproxy.client.util.ProxyUtil;
|
||||
import org.dromara.neutrinoproxy.core.ProxyMessage;
|
||||
import org.dromara.neutrinoproxy.core.ProxyMessageDecoder;
|
||||
import org.dromara.neutrinoproxy.core.ProxyMessageEncoder;
|
||||
import org.dromara.neutrinoproxy.core.util.FileUtil;
|
||||
import io.netty.bootstrap.Bootstrap;
|
||||
import io.netty.channel.*;
|
||||
import io.netty.channel.nio.NioEventLoopGroup;
|
||||
@@ -20,11 +20,11 @@
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package fun.asgc.neutrino.proxy.client.core;
|
||||
package org.dromara.neutrinoproxy.client.core;
|
||||
|
||||
import fun.asgc.neutrino.proxy.client.util.ProxyUtil;
|
||||
import fun.asgc.neutrino.proxy.core.Constants;
|
||||
import fun.asgc.neutrino.proxy.core.ProxyMessage;
|
||||
import org.dromara.neutrinoproxy.client.util.ProxyUtil;
|
||||
import org.dromara.neutrinoproxy.core.Constants;
|
||||
import org.dromara.neutrinoproxy.core.ProxyMessage;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.channel.Channel;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
@@ -1,10 +1,10 @@
|
||||
package fun.asgc.neutrino.proxy.client.handler;
|
||||
package org.dromara.neutrinoproxy.client.handler;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import fun.asgc.neutrino.proxy.core.Constants;
|
||||
import fun.asgc.neutrino.proxy.core.ProxyMessage;
|
||||
import fun.asgc.neutrino.proxy.core.ProxyMessageHandler;
|
||||
import fun.asgc.neutrino.proxy.core.dispatcher.Match;
|
||||
import org.dromara.neutrinoproxy.core.Constants;
|
||||
import org.dromara.neutrinoproxy.core.ProxyMessage;
|
||||
import org.dromara.neutrinoproxy.core.ProxyMessageHandler;
|
||||
import org.dromara.neutrinoproxy.core.dispatcher.Match;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.noear.solon.annotation.Component;
|
||||
@@ -1,13 +1,13 @@
|
||||
package fun.asgc.neutrino.proxy.client.handler;
|
||||
package org.dromara.neutrinoproxy.client.handler;
|
||||
|
||||
import fun.asgc.neutrino.proxy.client.config.ProxyConfig;
|
||||
import fun.asgc.neutrino.proxy.client.core.ProxyChannelBorrowListener;
|
||||
import fun.asgc.neutrino.proxy.client.util.ProxyUtil;
|
||||
import fun.asgc.neutrino.proxy.core.Constants;
|
||||
import fun.asgc.neutrino.proxy.core.ProxyDataTypeEnum;
|
||||
import fun.asgc.neutrino.proxy.core.ProxyMessage;
|
||||
import fun.asgc.neutrino.proxy.core.ProxyMessageHandler;
|
||||
import fun.asgc.neutrino.proxy.core.dispatcher.Match;
|
||||
import org.dromara.neutrinoproxy.client.config.ProxyConfig;
|
||||
import org.dromara.neutrinoproxy.client.core.ProxyChannelBorrowListener;
|
||||
import org.dromara.neutrinoproxy.client.util.ProxyUtil;
|
||||
import org.dromara.neutrinoproxy.core.Constants;
|
||||
import org.dromara.neutrinoproxy.core.ProxyDataTypeEnum;
|
||||
import org.dromara.neutrinoproxy.core.ProxyMessage;
|
||||
import org.dromara.neutrinoproxy.core.ProxyMessageHandler;
|
||||
import org.dromara.neutrinoproxy.core.dispatcher.Match;
|
||||
import io.netty.bootstrap.Bootstrap;
|
||||
import io.netty.channel.*;
|
||||
import org.noear.solon.annotation.Component;
|
||||
@@ -1,11 +1,11 @@
|
||||
package fun.asgc.neutrino.proxy.client.handler;
|
||||
package org.dromara.neutrinoproxy.client.handler;
|
||||
|
||||
import fun.asgc.neutrino.proxy.client.util.ProxyUtil;
|
||||
import fun.asgc.neutrino.proxy.core.Constants;
|
||||
import fun.asgc.neutrino.proxy.core.ProxyDataTypeEnum;
|
||||
import fun.asgc.neutrino.proxy.core.ProxyMessage;
|
||||
import fun.asgc.neutrino.proxy.core.ProxyMessageHandler;
|
||||
import fun.asgc.neutrino.proxy.core.dispatcher.Match;
|
||||
import org.dromara.neutrinoproxy.client.util.ProxyUtil;
|
||||
import org.dromara.neutrinoproxy.core.Constants;
|
||||
import org.dromara.neutrinoproxy.core.ProxyDataTypeEnum;
|
||||
import org.dromara.neutrinoproxy.core.ProxyMessage;
|
||||
import org.dromara.neutrinoproxy.core.ProxyMessageHandler;
|
||||
import org.dromara.neutrinoproxy.core.dispatcher.Match;
|
||||
import io.netty.buffer.Unpooled;
|
||||
import io.netty.channel.Channel;
|
||||
import io.netty.channel.ChannelFutureListener;
|
||||
@@ -1,8 +1,9 @@
|
||||
package fun.asgc.neutrino.proxy.client.handler;
|
||||
package org.dromara.neutrinoproxy.client.handler;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import fun.asgc.neutrino.proxy.core.*;
|
||||
import fun.asgc.neutrino.proxy.core.dispatcher.Match;
|
||||
import org.dromara.neutrinoproxy.core.*;
|
||||
import org.dromara.neutrinoproxy.core.*;
|
||||
import org.dromara.neutrinoproxy.core.dispatcher.Match;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.noear.solon.annotation.Component;
|
||||
@@ -1,10 +1,10 @@
|
||||
package fun.asgc.neutrino.proxy.client.handler;
|
||||
package org.dromara.neutrinoproxy.client.handler;
|
||||
|
||||
import fun.asgc.neutrino.proxy.core.Constants;
|
||||
import fun.asgc.neutrino.proxy.core.ProxyDataTypeEnum;
|
||||
import fun.asgc.neutrino.proxy.core.ProxyMessage;
|
||||
import fun.asgc.neutrino.proxy.core.ProxyMessageHandler;
|
||||
import fun.asgc.neutrino.proxy.core.dispatcher.Match;
|
||||
import org.dromara.neutrinoproxy.core.Constants;
|
||||
import org.dromara.neutrinoproxy.core.ProxyDataTypeEnum;
|
||||
import org.dromara.neutrinoproxy.core.ProxyMessage;
|
||||
import org.dromara.neutrinoproxy.core.ProxyMessageHandler;
|
||||
import org.dromara.neutrinoproxy.core.dispatcher.Match;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.channel.Channel;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
@@ -19,15 +19,13 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.client.util;
|
||||
package org.dromara.neutrinoproxy.client.util;
|
||||
|
||||
import fun.asgc.neutrino.proxy.client.config.ProxyConfig;
|
||||
import fun.asgc.neutrino.proxy.client.core.ProxyChannelBorrowListener;
|
||||
import fun.asgc.neutrino.proxy.core.Constants;
|
||||
import org.dromara.neutrinoproxy.client.core.ProxyChannelBorrowListener;
|
||||
import org.dromara.neutrinoproxy.core.Constants;
|
||||
import io.netty.bootstrap.Bootstrap;
|
||||
import io.netty.buffer.Unpooled;
|
||||
import io.netty.channel.Channel;
|
||||
import io.netty.channel.ChannelFuture;
|
||||
import io.netty.channel.ChannelFutureListener;
|
||||
import io.netty.channel.ChannelOption;
|
||||
import io.netty.util.AttributeKey;
|
||||
@@ -20,4 +20,4 @@ neutrino:
|
||||
server-port: 9002
|
||||
ssl-enable: true
|
||||
obtain-license-interval: 5
|
||||
license-key:
|
||||
license-key: b0a907332b474b25897c4dcb31fc7eb6
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>neutrino-proxy</artifactId>
|
||||
<groupId>fun.asgc.neutrino</groupId>
|
||||
<artifactId>neutrino-proxy-parent</artifactId>
|
||||
<groupId>org.dromara.neutrino-proxy</groupId>
|
||||
<version>${revision}</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
@@ -21,7 +21,7 @@
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-core</artifactId>
|
||||
<version>${hutool.ver}</version>
|
||||
<version>${hutool.version}</version>
|
||||
</dependency>
|
||||
<!--lombok-->
|
||||
<dependency>
|
||||
|
||||
@@ -19,10 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.core;
|
||||
|
||||
import io.netty.channel.Channel;
|
||||
import io.netty.util.AttributeKey;
|
||||
package org.dromara.neutrinoproxy.core;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package fun.asgc.neutrino.proxy.core;
|
||||
package org.dromara.neutrinoproxy.core;
|
||||
|
||||
import io.netty.channel.Channel;
|
||||
import io.netty.util.AttributeKey;
|
||||
@@ -20,7 +20,7 @@
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package fun.asgc.neutrino.proxy.core;
|
||||
package org.dromara.neutrinoproxy.core;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
@@ -20,7 +20,7 @@
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package fun.asgc.neutrino.proxy.core;
|
||||
package org.dromara.neutrinoproxy.core;
|
||||
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.handler.timeout.IdleStateEvent;
|
||||
@@ -20,7 +20,7 @@
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package fun.asgc.neutrino.proxy.core;
|
||||
package org.dromara.neutrinoproxy.core;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package fun.asgc.neutrino.proxy.core;
|
||||
package org.dromara.neutrinoproxy.core;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
@@ -20,7 +20,7 @@
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package fun.asgc.neutrino.proxy.core;
|
||||
package org.dromara.neutrinoproxy.core;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.Data;
|
||||
@@ -20,12 +20,12 @@
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package fun.asgc.neutrino.proxy.core;
|
||||
package org.dromara.neutrinoproxy.core;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.handler.codec.LengthFieldBasedFrameDecoder;
|
||||
import static fun.asgc.neutrino.proxy.core.Constants.*;
|
||||
import static org.dromara.neutrinoproxy.core.Constants.*;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -20,12 +20,12 @@
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package fun.asgc.neutrino.proxy.core;
|
||||
package org.dromara.neutrinoproxy.core;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.handler.codec.MessageToByteEncoder;
|
||||
import static fun.asgc.neutrino.proxy.core.Constants.*;
|
||||
import static org.dromara.neutrinoproxy.core.Constants.*;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -1,6 +1,6 @@
|
||||
package fun.asgc.neutrino.proxy.core;
|
||||
package org.dromara.neutrinoproxy.core;
|
||||
|
||||
import fun.asgc.neutrino.proxy.core.dispatcher.Handler;
|
||||
import org.dromara.neutrinoproxy.core.dispatcher.Handler;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
|
||||
/**
|
||||
@@ -20,7 +20,7 @@
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package fun.asgc.neutrino.proxy.core.base;
|
||||
package org.dromara.neutrinoproxy.core.base;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
|
||||
package fun.asgc.neutrino.proxy.core.base;
|
||||
package org.dromara.neutrinoproxy.core.base;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -1,4 +1,4 @@
|
||||
package fun.asgc.neutrino.proxy.core.base;
|
||||
package org.dromara.neutrinoproxy.core.base;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -1,10 +1,10 @@
|
||||
package fun.asgc.neutrino.proxy.core.dispatcher;
|
||||
package org.dromara.neutrinoproxy.core.dispatcher;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import fun.asgc.neutrino.proxy.core.util.TypeUtil;
|
||||
import org.dromara.neutrinoproxy.core.util.TypeUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.HashMap;
|
||||
@@ -20,7 +20,7 @@
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package fun.asgc.neutrino.proxy.core.dispatcher;
|
||||
package org.dromara.neutrinoproxy.core.dispatcher;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -20,7 +20,7 @@
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package fun.asgc.neutrino.proxy.core.dispatcher;
|
||||
package org.dromara.neutrinoproxy.core.dispatcher;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -20,7 +20,7 @@
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package fun.asgc.neutrino.proxy.core.dispatcher;
|
||||
package org.dromara.neutrinoproxy.core.dispatcher;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package fun.asgc.neutrino.proxy.core.type;
|
||||
package org.dromara.neutrinoproxy.core.type;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -1,6 +1,6 @@
|
||||
package fun.asgc.neutrino.proxy.core.type;
|
||||
package org.dromara.neutrinoproxy.core.type;
|
||||
|
||||
import fun.asgc.neutrino.proxy.core.util.TypeUtil;
|
||||
import org.dromara.neutrinoproxy.core.util.TypeUtil;
|
||||
|
||||
/**
|
||||
* 默认的类型匹配器组
|
||||
@@ -1,4 +1,4 @@
|
||||
package fun.asgc.neutrino.proxy.core.type;
|
||||
package org.dromara.neutrinoproxy.core.type;
|
||||
|
||||
/**
|
||||
* 类型转换器
|
||||
@@ -1,4 +1,4 @@
|
||||
package fun.asgc.neutrino.proxy.core.type;
|
||||
package org.dromara.neutrinoproxy.core.type;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
@@ -1,4 +1,4 @@
|
||||
package fun.asgc.neutrino.proxy.core.type;
|
||||
package org.dromara.neutrinoproxy.core.type;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
package fun.asgc.neutrino.proxy.core.type;
|
||||
package org.dromara.neutrinoproxy.core.type;
|
||||
|
||||
/**
|
||||
* 值类型匹配器
|
||||
@@ -1,4 +1,4 @@
|
||||
package fun.asgc.neutrino.proxy.core.type;
|
||||
package org.dromara.neutrinoproxy.core.type;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -1,29 +1,9 @@
|
||||
/**
|
||||
* 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 fun.asgc.neutrino.proxy.core.type;
|
||||
package org.dromara.neutrinoproxy.core.type;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import fun.asgc.neutrino.proxy.core.type.extension.*;
|
||||
import fun.asgc.neutrino.proxy.core.util.Assert;
|
||||
import org.dromara.neutrinoproxy.core.type.extension.*;
|
||||
import org.dromara.neutrinoproxy.core.util.Assert;
|
||||
import org.dromara.neutrinoproxy.core.type.extension.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
@@ -1,8 +1,8 @@
|
||||
package fun.asgc.neutrino.proxy.core.type.extension;
|
||||
package org.dromara.neutrinoproxy.core.type.extension;
|
||||
|
||||
import fun.asgc.neutrino.proxy.core.type.AbstractMatcherGroup;
|
||||
import fun.asgc.neutrino.proxy.core.type.TypeMatchInfo;
|
||||
import fun.asgc.neutrino.proxy.core.type.TypeMatcher;
|
||||
import org.dromara.neutrinoproxy.core.type.AbstractMatcherGroup;
|
||||
import org.dromara.neutrinoproxy.core.type.TypeMatchInfo;
|
||||
import org.dromara.neutrinoproxy.core.type.TypeMatcher;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
@@ -1,9 +1,9 @@
|
||||
package fun.asgc.neutrino.proxy.core.type.extension;
|
||||
package org.dromara.neutrinoproxy.core.type.extension;
|
||||
|
||||
import fun.asgc.neutrino.proxy.core.type.AbstractMatcherGroup;
|
||||
import fun.asgc.neutrino.proxy.core.type.TypeMatchInfo;
|
||||
import fun.asgc.neutrino.proxy.core.type.TypeMatcher;
|
||||
import fun.asgc.neutrino.proxy.core.util.TypeUtil;
|
||||
import org.dromara.neutrinoproxy.core.type.AbstractMatcherGroup;
|
||||
import org.dromara.neutrinoproxy.core.type.TypeMatchInfo;
|
||||
import org.dromara.neutrinoproxy.core.type.TypeMatcher;
|
||||
import org.dromara.neutrinoproxy.core.util.TypeUtil;
|
||||
|
||||
/**
|
||||
* 布尔值匹配器组
|
||||
@@ -1,9 +1,9 @@
|
||||
package fun.asgc.neutrino.proxy.core.type.extension;
|
||||
package org.dromara.neutrinoproxy.core.type.extension;
|
||||
|
||||
import fun.asgc.neutrino.proxy.core.type.AbstractMatcherGroup;
|
||||
import fun.asgc.neutrino.proxy.core.type.TypeMatchInfo;
|
||||
import fun.asgc.neutrino.proxy.core.type.TypeMatcher;
|
||||
import fun.asgc.neutrino.proxy.core.util.TypeUtil;
|
||||
import org.dromara.neutrinoproxy.core.type.AbstractMatcherGroup;
|
||||
import org.dromara.neutrinoproxy.core.type.TypeMatchInfo;
|
||||
import org.dromara.neutrinoproxy.core.type.TypeMatcher;
|
||||
import org.dromara.neutrinoproxy.core.util.TypeUtil;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDateTime;
|
||||
@@ -1,8 +1,8 @@
|
||||
package fun.asgc.neutrino.proxy.core.type.extension;
|
||||
package org.dromara.neutrinoproxy.core.type.extension;
|
||||
|
||||
import fun.asgc.neutrino.proxy.core.type.AbstractMatcherGroup;
|
||||
import fun.asgc.neutrino.proxy.core.type.TypeMatchInfo;
|
||||
import fun.asgc.neutrino.proxy.core.type.TypeMatcher;
|
||||
import org.dromara.neutrinoproxy.core.type.AbstractMatcherGroup;
|
||||
import org.dromara.neutrinoproxy.core.type.TypeMatchInfo;
|
||||
import org.dromara.neutrinoproxy.core.type.TypeMatcher;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -1,6 +1,6 @@
|
||||
package fun.asgc.neutrino.proxy.core.type.extension;
|
||||
package org.dromara.neutrinoproxy.core.type.extension;
|
||||
|
||||
import fun.asgc.neutrino.proxy.core.type.AbstractMatcherGroup;
|
||||
import org.dromara.neutrinoproxy.core.type.AbstractMatcherGroup;
|
||||
|
||||
/**
|
||||
* Map匹配器组
|
||||
@@ -1,9 +1,9 @@
|
||||
package fun.asgc.neutrino.proxy.core.type.extension;
|
||||
package org.dromara.neutrinoproxy.core.type.extension;
|
||||
|
||||
import fun.asgc.neutrino.proxy.core.type.AbstractMatcherGroup;
|
||||
import fun.asgc.neutrino.proxy.core.type.TypeMatchInfo;
|
||||
import fun.asgc.neutrino.proxy.core.type.TypeMatcher;
|
||||
import fun.asgc.neutrino.proxy.core.util.TypeUtil;
|
||||
import org.dromara.neutrinoproxy.core.type.AbstractMatcherGroup;
|
||||
import org.dromara.neutrinoproxy.core.type.TypeMatchInfo;
|
||||
import org.dromara.neutrinoproxy.core.type.TypeMatcher;
|
||||
import org.dromara.neutrinoproxy.core.util.TypeUtil;
|
||||
|
||||
/**
|
||||
* 字符串匹配器组
|
||||
@@ -1,8 +1,8 @@
|
||||
package fun.asgc.neutrino.proxy.core.type.extension;
|
||||
package org.dromara.neutrinoproxy.core.type.extension;
|
||||
|
||||
import fun.asgc.neutrino.proxy.core.type.AbstractMatcherGroup;
|
||||
import fun.asgc.neutrino.proxy.core.type.TypeMatchInfo;
|
||||
import fun.asgc.neutrino.proxy.core.type.TypeMatcher;
|
||||
import org.dromara.neutrinoproxy.core.type.AbstractMatcherGroup;
|
||||
import org.dromara.neutrinoproxy.core.type.TypeMatchInfo;
|
||||
import org.dromara.neutrinoproxy.core.type.TypeMatcher;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Set;
|
||||
@@ -1,9 +1,9 @@
|
||||
package fun.asgc.neutrino.proxy.core.type.extension;
|
||||
package org.dromara.neutrinoproxy.core.type.extension;
|
||||
|
||||
import fun.asgc.neutrino.proxy.core.type.AbstractMatcherGroup;
|
||||
import fun.asgc.neutrino.proxy.core.type.TypeMatchInfo;
|
||||
import fun.asgc.neutrino.proxy.core.type.TypeMatcher;
|
||||
import fun.asgc.neutrino.proxy.core.util.TypeUtil;
|
||||
import org.dromara.neutrinoproxy.core.type.AbstractMatcherGroup;
|
||||
import org.dromara.neutrinoproxy.core.type.TypeMatchInfo;
|
||||
import org.dromara.neutrinoproxy.core.type.TypeMatcher;
|
||||
import org.dromara.neutrinoproxy.core.util.TypeUtil;
|
||||
|
||||
/**
|
||||
* 字符串匹配器组
|
||||
@@ -1,4 +1,4 @@
|
||||
package fun.asgc.neutrino.proxy.core.util;
|
||||
package org.dromara.neutrinoproxy.core.util;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
@@ -1,4 +1,4 @@
|
||||
package fun.asgc.neutrino.proxy.core.util;
|
||||
package org.dromara.neutrinoproxy.core.util;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package fun.asgc.neutrino.proxy.core.util;
|
||||
package org.dromara.neutrinoproxy.core.util;
|
||||
|
||||
import fun.asgc.neutrino.proxy.core.base.InternalException;
|
||||
import fun.asgc.neutrino.proxy.core.base.MetaDataConstant;
|
||||
import org.dromara.neutrinoproxy.core.base.InternalException;
|
||||
import org.dromara.neutrinoproxy.core.base.MetaDataConstant;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.io.*;
|
||||
@@ -1,6 +1,6 @@
|
||||
package fun.asgc.neutrino.proxy.core.util;
|
||||
package org.dromara.neutrinoproxy.core.util;
|
||||
|
||||
import fun.asgc.neutrino.proxy.core.base.CodeBlock;
|
||||
import org.dromara.neutrinoproxy.core.base.CodeBlock;
|
||||
|
||||
import java.util.function.BooleanSupplier;
|
||||
import java.util.function.Supplier;
|
||||
@@ -1,11 +1,11 @@
|
||||
package fun.asgc.neutrino.proxy.core.util;
|
||||
package org.dromara.neutrinoproxy.core.util;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.lang.Pair;
|
||||
import com.google.common.collect.Lists;
|
||||
import fun.asgc.neutrino.proxy.core.type.TypeMatchInfo;
|
||||
import fun.asgc.neutrino.proxy.core.type.TypeMatchers;
|
||||
import org.dromara.neutrinoproxy.core.type.TypeMatchInfo;
|
||||
import org.dromara.neutrinoproxy.core.type.TypeMatchers;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.*;
|
||||
@@ -3,8 +3,8 @@
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>neutrino-proxy</artifactId>
|
||||
<groupId>fun.asgc.neutrino</groupId>
|
||||
<artifactId>neutrino-proxy-parent</artifactId>
|
||||
<groupId>org.dromara.neutrino-proxy</groupId>
|
||||
<version>${revision}</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
@@ -43,7 +43,7 @@
|
||||
<version>2.2.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fun.asgc.neutrino</groupId>
|
||||
<groupId>org.dromara.neutrino-proxy</groupId>
|
||||
<artifactId>neutrino-proxy-core</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
@@ -61,28 +61,9 @@
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<!-- <build>-->
|
||||
<!-- <finalName>${artifactId}</finalName>-->
|
||||
<!-- <plugins>-->
|
||||
<!-- <plugin>-->
|
||||
<!-- <groupId>org.springframework.boot</groupId>-->
|
||||
<!-- <artifactId>spring-boot-maven-plugin</artifactId>-->
|
||||
<!-- <version>2.1.3.RELEASE</version>-->
|
||||
<!-- <configuration>-->
|
||||
<!-- <mainClass>fun.asgc.neutrino.proxy.server.ProxyServer</mainClass>-->
|
||||
<!-- </configuration>-->
|
||||
<!-- <executions>-->
|
||||
<!-- <execution>-->
|
||||
<!-- <goals>-->
|
||||
<!-- <goal>repackage</goal>-->
|
||||
<!-- </goals>-->
|
||||
<!-- </execution>-->
|
||||
<!-- </executions>-->
|
||||
<!-- </plugin>-->
|
||||
<!-- </plugins>-->
|
||||
<!-- </build>-->
|
||||
|
||||
<build>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>${project.basedir}/src/main/resources</directory>
|
||||
@@ -94,31 +75,10 @@
|
||||
</resource>
|
||||
</resources>
|
||||
<plugins>
|
||||
<!-- 配置打包插件(并打包成胖包) -->
|
||||
<plugin>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<configuration>
|
||||
<encoding>${project.build.sourceEncoding}</encoding>
|
||||
<appendAssemblyId>false</appendAssemblyId>
|
||||
<finalName>${artifactId}</finalName>
|
||||
<archive>
|
||||
<manifest>
|
||||
<!--这里指定要运行的main类-->
|
||||
<mainClass>fun.asgc.neutrino.proxy.server.ProxyServer</mainClass>
|
||||
</manifest>
|
||||
</archive>
|
||||
<descriptorRefs>
|
||||
<descriptorRef>jar-with-dependencies</descriptorRef>
|
||||
</descriptorRefs>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>make-assembly</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<groupId>org.noear</groupId>
|
||||
<artifactId>solon-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
package fun.asgc.neutrino.proxy.server.controller.res.system;
|
||||
|
||||
public class PortGroupCreateRes {
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
package fun.asgc.neutrino.proxy.server.controller.res.system;
|
||||
|
||||
public class PortPoolUpdateGroupRes {
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
/**
|
||||
* 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 fun.asgc.neutrino.proxy.server.proxy.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author: aoshiguchen
|
||||
* @date: 2022/6/16
|
||||
*/
|
||||
@Data
|
||||
public class Metrics implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
private int port;
|
||||
private long readBytes;
|
||||
private long wroteBytes;
|
||||
private long readMsgs;
|
||||
private long wroteMsgs;
|
||||
private int channels;
|
||||
private long timestamp;
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package fun.asgc.neutrino.proxy.server;
|
||||
package org.dromara.neutrinoproxy.server;
|
||||
|
||||
import fun.asgc.solon.extend.job.annotation.EnableJob;
|
||||
import org.noear.solon.Solon;
|
||||
@@ -19,15 +19,15 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.base.db;
|
||||
package org.dromara.neutrinoproxy.server.base.db;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.jfinal.plugin.activerecord.Db;
|
||||
import fun.asgc.neutrino.proxy.core.util.Assert;
|
||||
import fun.asgc.neutrino.proxy.core.util.FileUtil;
|
||||
import fun.asgc.neutrino.proxy.server.constant.DbTypeEnum;
|
||||
import org.dromara.neutrinoproxy.core.util.Assert;
|
||||
import org.dromara.neutrinoproxy.core.util.FileUtil;
|
||||
import org.dromara.neutrinoproxy.server.constant.DbTypeEnum;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.noear.solon.annotation.Component;
|
||||
import org.noear.solon.annotation.Init;
|
||||
@@ -19,9 +19,9 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.base.db;
|
||||
package org.dromara.neutrinoproxy.server.base.db;
|
||||
|
||||
import fun.asgc.neutrino.proxy.server.constant.DbTypeEnum;
|
||||
import org.dromara.neutrinoproxy.server.constant.DbTypeEnum;
|
||||
import lombok.Data;
|
||||
import org.noear.solon.annotation.Component;
|
||||
import org.noear.solon.annotation.Inject;
|
||||
@@ -1,11 +1,11 @@
|
||||
package fun.asgc.neutrino.proxy.server.base.db;
|
||||
package org.dromara.neutrinoproxy.server.base.db;
|
||||
|
||||
import com.baomidou.mybatisplus.core.MybatisConfiguration;
|
||||
import com.baomidou.mybatisplus.core.MybatisSqlSessionFactoryBuilder;
|
||||
import com.baomidou.mybatisplus.core.config.GlobalConfig;
|
||||
import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
|
||||
import com.zaxxer.hikari.HikariDataSource;
|
||||
import fun.asgc.neutrino.proxy.server.constant.DbTypeEnum;
|
||||
import org.dromara.neutrinoproxy.server.constant.DbTypeEnum;
|
||||
import org.apache.ibatis.solon.annotation.Db;
|
||||
import org.noear.solon.annotation.Bean;
|
||||
import org.noear.solon.annotation.Configuration;
|
||||
@@ -1,4 +1,4 @@
|
||||
package fun.asgc.neutrino.proxy.server.base.db;
|
||||
package org.dromara.neutrinoproxy.server.base.db;
|
||||
|
||||
import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
|
||||
import org.apache.ibatis.reflection.MetaObject;
|
||||
@@ -1,4 +1,4 @@
|
||||
package fun.asgc.neutrino.proxy.server.base.db;
|
||||
package org.dromara.neutrinoproxy.server.base.db;
|
||||
|
||||
import com.baomidou.mybatisplus.core.MybatisSqlSessionFactoryBuilder;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package fun.asgc.neutrino.proxy.server.base.page;
|
||||
package org.dromara.neutrinoproxy.server.base.page;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package fun.asgc.neutrino.proxy.server.base.page;
|
||||
package org.dromara.neutrinoproxy.server.base.page;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package fun.asgc.neutrino.proxy.server.base.proxy;
|
||||
package org.dromara.neutrinoproxy.server.base.proxy;
|
||||
|
||||
import lombok.Data;
|
||||
import org.noear.solon.annotation.Component;
|
||||
@@ -44,6 +44,7 @@ public class ProxyConfig {
|
||||
private String jksPath;
|
||||
private Integer bossThreadCount;
|
||||
private Integer workThreadCount;
|
||||
private String domainName;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,17 +1,16 @@
|
||||
package fun.asgc.neutrino.proxy.server.base.proxy;
|
||||
package org.dromara.neutrinoproxy.server.base.proxy;
|
||||
|
||||
import fun.asgc.neutrino.proxy.core.ProxyDataTypeEnum;
|
||||
import fun.asgc.neutrino.proxy.core.ProxyMessage;
|
||||
import fun.asgc.neutrino.proxy.core.ProxyMessageHandler;
|
||||
import fun.asgc.neutrino.proxy.core.dispatcher.DefaultDispatcher;
|
||||
import fun.asgc.neutrino.proxy.core.dispatcher.Dispatcher;
|
||||
import org.dromara.neutrinoproxy.core.ProxyDataTypeEnum;
|
||||
import org.dromara.neutrinoproxy.core.ProxyMessage;
|
||||
import org.dromara.neutrinoproxy.core.ProxyMessageHandler;
|
||||
import org.dromara.neutrinoproxy.core.dispatcher.DefaultDispatcher;
|
||||
import org.dromara.neutrinoproxy.core.dispatcher.Dispatcher;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.channel.nio.NioEventLoopGroup;
|
||||
import org.noear.solon.Solon;
|
||||
import org.noear.solon.annotation.Bean;
|
||||
import org.noear.solon.annotation.Configuration;
|
||||
import org.noear.solon.annotation.Inject;
|
||||
import org.noear.solon.core.AopContext;
|
||||
import org.noear.solon.core.bean.LifecycleBean;
|
||||
|
||||
import java.util.List;
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.base.rest;
|
||||
package org.dromara.neutrinoproxy.server.base.rest;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.base.rest;
|
||||
package org.dromara.neutrinoproxy.server.base.rest;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
@@ -19,9 +19,9 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.base.rest;
|
||||
package org.dromara.neutrinoproxy.server.base.rest;
|
||||
|
||||
import fun.asgc.neutrino.proxy.server.constant.ExceptionConstant;
|
||||
import org.dromara.neutrinoproxy.server.constant.ExceptionConstant;
|
||||
import lombok.Getter;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
@@ -19,9 +19,9 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.base.rest;
|
||||
package org.dromara.neutrinoproxy.server.base.rest;
|
||||
|
||||
import fun.asgc.neutrino.proxy.server.dal.entity.UserDO;
|
||||
import org.dromara.neutrinoproxy.server.dal.entity.UserDO;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.noear.solon.core.handle.Action;
|
||||
@@ -19,9 +19,9 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.base.rest;
|
||||
package org.dromara.neutrinoproxy.server.base.rest;
|
||||
|
||||
import fun.asgc.neutrino.proxy.server.dal.entity.UserDO;
|
||||
import org.dromara.neutrinoproxy.server.dal.entity.UserDO;
|
||||
|
||||
/**
|
||||
* 系统上下文持有者
|
||||
@@ -1,13 +1,14 @@
|
||||
package fun.asgc.neutrino.proxy.server.base.rest.interceptor;
|
||||
package org.dromara.neutrinoproxy.server.base.rest.interceptor;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import fun.asgc.neutrino.proxy.server.base.rest.*;
|
||||
import fun.asgc.neutrino.proxy.server.constant.EnableStatusEnum;
|
||||
import fun.asgc.neutrino.proxy.server.constant.ExceptionConstant;
|
||||
import fun.asgc.neutrino.proxy.server.dal.entity.UserDO;
|
||||
import fun.asgc.neutrino.proxy.server.service.UserService;
|
||||
import org.dromara.neutrinoproxy.server.base.rest.*;
|
||||
import org.dromara.neutrinoproxy.server.constant.EnableStatusEnum;
|
||||
import org.dromara.neutrinoproxy.server.constant.ExceptionConstant;
|
||||
import org.dromara.neutrinoproxy.server.dal.entity.UserDO;
|
||||
import org.dromara.neutrinoproxy.server.service.UserService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.exception.ExceptionUtils;
|
||||
import org.dromara.neutrinoproxy.server.base.rest.*;
|
||||
import org.noear.solon.Solon;
|
||||
import org.noear.solon.annotation.Component;
|
||||
import org.noear.solon.core.handle.Action;
|
||||
@@ -1,8 +1,8 @@
|
||||
package fun.asgc.neutrino.proxy.server.base.rest.interceptor;
|
||||
package org.dromara.neutrinoproxy.server.base.rest.interceptor;
|
||||
|
||||
import fun.asgc.neutrino.proxy.server.base.rest.ResponseBody;
|
||||
import fun.asgc.neutrino.proxy.server.base.rest.ServiceException;
|
||||
import fun.asgc.neutrino.proxy.server.constant.ExceptionConstant;
|
||||
import org.dromara.neutrinoproxy.server.base.rest.ResponseBody;
|
||||
import org.dromara.neutrinoproxy.server.base.rest.ServiceException;
|
||||
import org.dromara.neutrinoproxy.server.constant.ExceptionConstant;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.exception.ExceptionUtils;
|
||||
import org.noear.solon.annotation.Component;
|
||||
@@ -1,4 +1,4 @@
|
||||
package fun.asgc.neutrino.proxy.server.base.rest.interceptor;
|
||||
package org.dromara.neutrinoproxy.server.base.rest.interceptor;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.constant;
|
||||
package org.dromara.neutrinoproxy.server.constant;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.constant;
|
||||
package org.dromara.neutrinoproxy.server.constant;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.constant;
|
||||
package org.dromara.neutrinoproxy.server.constant;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
@@ -1,4 +1,4 @@
|
||||
package fun.asgc.neutrino.proxy.server.constant;
|
||||
package org.dromara.neutrinoproxy.server.constant;
|
||||
|
||||
/**
|
||||
* @author: aoshiguchen
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.constant;
|
||||
package org.dromara.neutrinoproxy.server.constant;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.constant;
|
||||
package org.dromara.neutrinoproxy.server.constant;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.constant;
|
||||
package org.dromara.neutrinoproxy.server.constant;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
@@ -51,9 +51,13 @@ public enum ExceptionConstant {
|
||||
// 端口池管理(13000)
|
||||
PORT_CANNOT_REPEAT(13000,"端口不能重复"),
|
||||
PORT_NOT_EXIST(13001, "该端口在端口池中不存在"),
|
||||
PORT_RANGE_FAIL(13002, "端口值范围为MIN-MAX"),
|
||||
// 端口映射管理(14000)
|
||||
PORT_MAPPING_NOT_EXIST(14000, "端口映射记录不存在"),
|
||||
PORT_CANNOT_REPEAT_MAPPING(14001, "服务端口[{}]不能重复映射"),
|
||||
AN_UNSUPPORTED_PROTOCOL(14002, "不支持的协议[{}]!"),
|
||||
PORT_MAPPING_SUBDONAME_CONNOT_REPEAT(14003, "子域名不能重复使用!"),
|
||||
|
||||
// 调度管理(15000)
|
||||
JOB_INFO_NOT_EXIST(15000, "调度管理记录不存在"),
|
||||
SYSTEM_ERROR(500, "系统异常"),
|
||||
@@ -0,0 +1,28 @@
|
||||
package org.dromara.neutrinoproxy.server.constant;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* @author: aoshiguchen
|
||||
* @date: 2023/4/2
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum NetworkProtocolEnum {
|
||||
TCP("TCP"),
|
||||
UDP("UDP"),
|
||||
HTTP("HTTP"),
|
||||
;
|
||||
private String desc;
|
||||
private static final Map<String, NetworkProtocolEnum> map = Stream.of(NetworkProtocolEnum.values()).collect(Collectors.toMap(NetworkProtocolEnum::getDesc, Function.identity()));
|
||||
|
||||
public static NetworkProtocolEnum of(String desc) {
|
||||
return map.get(desc);
|
||||
}
|
||||
}
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.constant;
|
||||
package org.dromara.neutrinoproxy.server.constant;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
@@ -1,4 +1,4 @@
|
||||
package fun.asgc.neutrino.proxy.server.constant;
|
||||
package org.dromara.neutrinoproxy.server.constant;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.constant;
|
||||
package org.dromara.neutrinoproxy.server.constant;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
@@ -19,14 +19,14 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.controller;
|
||||
package org.dromara.neutrinoproxy.server.controller;
|
||||
|
||||
import fun.asgc.neutrino.proxy.server.base.page.PageInfo;
|
||||
import fun.asgc.neutrino.proxy.server.base.page.PageQuery;
|
||||
import fun.asgc.neutrino.proxy.server.controller.req.log.ClientConnectRecordListReq;
|
||||
import fun.asgc.neutrino.proxy.server.controller.res.log.ClientConnectRecordListRes;
|
||||
import fun.asgc.neutrino.proxy.server.service.ClientConnectRecordService;
|
||||
import fun.asgc.neutrino.proxy.server.util.ParamCheckUtil;
|
||||
import org.dromara.neutrinoproxy.server.base.page.PageInfo;
|
||||
import org.dromara.neutrinoproxy.server.base.page.PageQuery;
|
||||
import org.dromara.neutrinoproxy.server.controller.req.log.ClientConnectRecordListReq;
|
||||
import org.dromara.neutrinoproxy.server.controller.res.log.ClientConnectRecordListRes;
|
||||
import org.dromara.neutrinoproxy.server.service.ClientConnectRecordService;
|
||||
import org.dromara.neutrinoproxy.server.util.ParamCheckUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.noear.solon.annotation.Controller;
|
||||
import org.noear.solon.annotation.Get;
|
||||
@@ -0,0 +1,27 @@
|
||||
package org.dromara.neutrinoproxy.server.controller;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.neutrinoproxy.server.base.proxy.ProxyConfig;
|
||||
import org.noear.solon.annotation.Controller;
|
||||
import org.noear.solon.annotation.Get;
|
||||
import org.noear.solon.annotation.Inject;
|
||||
import org.noear.solon.annotation.Mapping;
|
||||
|
||||
/**
|
||||
* @author: aoshiguchen
|
||||
* @date: 2023/4/2
|
||||
*/
|
||||
@Slf4j
|
||||
@Mapping("/domain-name")
|
||||
@Controller
|
||||
public class DomainNameController {
|
||||
@Inject
|
||||
private ProxyConfig proxyConfig;
|
||||
|
||||
@Get
|
||||
@Mapping("/bind-info")
|
||||
public String bindInfo () {
|
||||
return proxyConfig.getServer().getDomainName();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -19,13 +19,13 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.controller;
|
||||
package org.dromara.neutrinoproxy.server.controller;
|
||||
|
||||
import fun.asgc.neutrino.proxy.server.base.rest.Authorization;
|
||||
import fun.asgc.neutrino.proxy.server.controller.req.system.LoginReq;
|
||||
import fun.asgc.neutrino.proxy.server.controller.res.system.LoginRes;
|
||||
import fun.asgc.neutrino.proxy.server.service.UserService;
|
||||
import fun.asgc.neutrino.proxy.server.util.ParamCheckUtil;
|
||||
import org.dromara.neutrinoproxy.server.base.rest.Authorization;
|
||||
import org.dromara.neutrinoproxy.server.controller.req.system.LoginReq;
|
||||
import org.dromara.neutrinoproxy.server.controller.res.system.LoginRes;
|
||||
import org.dromara.neutrinoproxy.server.service.UserService;
|
||||
import org.dromara.neutrinoproxy.server.util.ParamCheckUtil;
|
||||
import org.noear.solon.annotation.*;
|
||||
import org.noear.solon.core.handle.Context;
|
||||
|
||||
@@ -19,22 +19,22 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.controller;
|
||||
package org.dromara.neutrinoproxy.server.controller;
|
||||
|
||||
import fun.asgc.neutrino.proxy.server.base.page.PageInfo;
|
||||
import fun.asgc.neutrino.proxy.server.base.page.PageQuery;
|
||||
import fun.asgc.neutrino.proxy.server.base.rest.Authorization;
|
||||
import fun.asgc.neutrino.proxy.server.controller.req.system.JobInfoExecuteReq;
|
||||
import fun.asgc.neutrino.proxy.server.controller.req.system.JobInfoListReq;
|
||||
import fun.asgc.neutrino.proxy.server.controller.req.system.JobInfoUpdateEnableStatusReq;
|
||||
import fun.asgc.neutrino.proxy.server.controller.req.system.JobInfoUpdateReq;
|
||||
import fun.asgc.neutrino.proxy.server.controller.res.system.JobInfoExecuteRes;
|
||||
import fun.asgc.neutrino.proxy.server.controller.res.system.JobInfoListRes;
|
||||
import fun.asgc.neutrino.proxy.server.controller.res.system.JobInfoUpdateEnableStatusRes;
|
||||
import fun.asgc.neutrino.proxy.server.controller.res.system.JobInfoUpdateRes;
|
||||
import fun.asgc.neutrino.proxy.server.dal.entity.JobInfoDO;
|
||||
import fun.asgc.neutrino.proxy.server.service.JobInfoService;
|
||||
import fun.asgc.neutrino.proxy.server.util.ParamCheckUtil;
|
||||
import org.dromara.neutrinoproxy.server.base.page.PageInfo;
|
||||
import org.dromara.neutrinoproxy.server.base.page.PageQuery;
|
||||
import org.dromara.neutrinoproxy.server.base.rest.Authorization;
|
||||
import org.dromara.neutrinoproxy.server.controller.req.system.JobInfoExecuteReq;
|
||||
import org.dromara.neutrinoproxy.server.controller.req.system.JobInfoListReq;
|
||||
import org.dromara.neutrinoproxy.server.controller.req.system.JobInfoUpdateEnableStatusReq;
|
||||
import org.dromara.neutrinoproxy.server.controller.req.system.JobInfoUpdateReq;
|
||||
import org.dromara.neutrinoproxy.server.controller.res.system.JobInfoExecuteRes;
|
||||
import org.dromara.neutrinoproxy.server.controller.res.system.JobInfoListRes;
|
||||
import org.dromara.neutrinoproxy.server.controller.res.system.JobInfoUpdateEnableStatusRes;
|
||||
import org.dromara.neutrinoproxy.server.controller.res.system.JobInfoUpdateRes;
|
||||
import org.dromara.neutrinoproxy.server.dal.entity.JobInfoDO;
|
||||
import org.dromara.neutrinoproxy.server.service.JobInfoService;
|
||||
import org.dromara.neutrinoproxy.server.util.ParamCheckUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.noear.solon.annotation.*;
|
||||
|
||||
@@ -19,14 +19,14 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.controller;
|
||||
package org.dromara.neutrinoproxy.server.controller;
|
||||
|
||||
import fun.asgc.neutrino.proxy.server.base.page.PageInfo;
|
||||
import fun.asgc.neutrino.proxy.server.base.page.PageQuery;
|
||||
import fun.asgc.neutrino.proxy.server.controller.req.log.JobLogListReq;
|
||||
import fun.asgc.neutrino.proxy.server.controller.res.log.JobLogListRes;
|
||||
import fun.asgc.neutrino.proxy.server.service.JobLogService;
|
||||
import fun.asgc.neutrino.proxy.server.util.ParamCheckUtil;
|
||||
import org.dromara.neutrinoproxy.server.base.page.PageInfo;
|
||||
import org.dromara.neutrinoproxy.server.base.page.PageQuery;
|
||||
import org.dromara.neutrinoproxy.server.controller.req.log.JobLogListReq;
|
||||
import org.dromara.neutrinoproxy.server.controller.res.log.JobLogListRes;
|
||||
import org.dromara.neutrinoproxy.server.service.JobLogService;
|
||||
import org.dromara.neutrinoproxy.server.util.ParamCheckUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.noear.solon.annotation.Controller;
|
||||
import org.noear.solon.annotation.Get;
|
||||
@@ -19,15 +19,17 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.controller;
|
||||
package org.dromara.neutrinoproxy.server.controller;
|
||||
|
||||
import fun.asgc.neutrino.proxy.server.base.page.PageInfo;
|
||||
import fun.asgc.neutrino.proxy.server.base.page.PageQuery;
|
||||
import fun.asgc.neutrino.proxy.server.base.rest.Authorization;
|
||||
import fun.asgc.neutrino.proxy.server.controller.req.proxy.*;
|
||||
import fun.asgc.neutrino.proxy.server.controller.res.proxy.*;
|
||||
import fun.asgc.neutrino.proxy.server.service.LicenseService;
|
||||
import fun.asgc.neutrino.proxy.server.util.ParamCheckUtil;
|
||||
import org.dromara.neutrinoproxy.server.base.page.PageInfo;
|
||||
import org.dromara.neutrinoproxy.server.base.page.PageQuery;
|
||||
import org.dromara.neutrinoproxy.server.base.rest.Authorization;
|
||||
import org.dromara.neutrinoproxy.server.controller.req.proxy.*;
|
||||
import org.dromara.neutrinoproxy.server.controller.res.proxy.*;
|
||||
import org.dromara.neutrinoproxy.server.controller.req.proxy.*;
|
||||
import org.dromara.neutrinoproxy.server.controller.res.proxy.*;
|
||||
import org.dromara.neutrinoproxy.server.service.LicenseService;
|
||||
import org.dromara.neutrinoproxy.server.util.ParamCheckUtil;
|
||||
import org.noear.solon.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
@@ -1,17 +1,17 @@
|
||||
package fun.asgc.neutrino.proxy.server.controller;
|
||||
package org.dromara.neutrinoproxy.server.controller;
|
||||
|
||||
import fun.asgc.neutrino.proxy.server.base.page.PageInfo;
|
||||
import fun.asgc.neutrino.proxy.server.base.page.PageQuery;
|
||||
import fun.asgc.neutrino.proxy.server.base.rest.Authorization;
|
||||
import fun.asgc.neutrino.proxy.server.controller.req.system.PortGroupCreateReq;
|
||||
import fun.asgc.neutrino.proxy.server.controller.req.system.PortGroupDeleteReq;
|
||||
import fun.asgc.neutrino.proxy.server.controller.req.system.PortGroupListReq;
|
||||
import fun.asgc.neutrino.proxy.server.controller.req.system.PortGroupUpdateEnableStatusReq;
|
||||
import fun.asgc.neutrino.proxy.server.controller.res.system.PortGroupCreateRes;
|
||||
import fun.asgc.neutrino.proxy.server.controller.res.system.PortGroupListRes;
|
||||
import fun.asgc.neutrino.proxy.server.controller.res.system.PortGroupUpdateEnableStatusRes;
|
||||
import fun.asgc.neutrino.proxy.server.service.PortGroupService;
|
||||
import fun.asgc.neutrino.proxy.server.util.ParamCheckUtil;
|
||||
import org.dromara.neutrinoproxy.server.base.page.PageInfo;
|
||||
import org.dromara.neutrinoproxy.server.base.page.PageQuery;
|
||||
import org.dromara.neutrinoproxy.server.base.rest.Authorization;
|
||||
import org.dromara.neutrinoproxy.server.controller.req.system.PortGroupCreateReq;
|
||||
import org.dromara.neutrinoproxy.server.controller.req.system.PortGroupDeleteReq;
|
||||
import org.dromara.neutrinoproxy.server.controller.req.system.PortGroupListReq;
|
||||
import org.dromara.neutrinoproxy.server.controller.req.system.PortGroupUpdateEnableStatusReq;
|
||||
import org.dromara.neutrinoproxy.server.controller.res.system.PortGroupCreateRes;
|
||||
import org.dromara.neutrinoproxy.server.controller.res.system.PortGroupListRes;
|
||||
import org.dromara.neutrinoproxy.server.controller.res.system.PortGroupUpdateEnableStatusRes;
|
||||
import org.dromara.neutrinoproxy.server.service.PortGroupService;
|
||||
import org.dromara.neutrinoproxy.server.util.ParamCheckUtil;
|
||||
import org.noear.solon.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
@@ -1,11 +1,15 @@
|
||||
package fun.asgc.neutrino.proxy.server.controller;
|
||||
package org.dromara.neutrinoproxy.server.controller;
|
||||
|
||||
import fun.asgc.neutrino.proxy.server.base.page.PageInfo;
|
||||
import fun.asgc.neutrino.proxy.server.base.page.PageQuery;
|
||||
import fun.asgc.neutrino.proxy.server.controller.req.proxy.*;
|
||||
import fun.asgc.neutrino.proxy.server.controller.res.proxy.*;
|
||||
import fun.asgc.neutrino.proxy.server.service.PortMappingService;
|
||||
import fun.asgc.neutrino.proxy.server.util.ParamCheckUtil;
|
||||
import org.dromara.neutrinoproxy.server.base.page.PageInfo;
|
||||
import org.dromara.neutrinoproxy.server.base.page.PageQuery;
|
||||
import org.dromara.neutrinoproxy.server.constant.ExceptionConstant;
|
||||
import org.dromara.neutrinoproxy.server.constant.NetworkProtocolEnum;
|
||||
import org.dromara.neutrinoproxy.server.controller.req.proxy.*;
|
||||
import org.dromara.neutrinoproxy.server.controller.res.proxy.*;
|
||||
import org.dromara.neutrinoproxy.server.controller.req.proxy.*;
|
||||
import org.dromara.neutrinoproxy.server.controller.res.proxy.*;
|
||||
import org.dromara.neutrinoproxy.server.service.PortMappingService;
|
||||
import org.dromara.neutrinoproxy.server.util.ParamCheckUtil;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.noear.solon.annotation.*;
|
||||
|
||||
@@ -35,10 +39,17 @@ public class PortMappingController {
|
||||
ParamCheckUtil.checkNotNull(req.getLicenseId(), "licenseId");
|
||||
ParamCheckUtil.checkNotNull(req.getServerPort(), "serverPort");
|
||||
ParamCheckUtil.checkNotNull(req.getClientPort(), "clientPort");
|
||||
ParamCheckUtil.checkNotEmpty(req.getProtocal(), "protocal");
|
||||
if (StringUtils.isBlank(req.getClientIp())) {
|
||||
// 没传客户端ip,默认为127.0.0.1
|
||||
req.setClientIp("127.0.0.1");
|
||||
}
|
||||
NetworkProtocolEnum networkProtocolEnum = NetworkProtocolEnum.of(req.getProtocal());
|
||||
ParamCheckUtil.checkNotNull(networkProtocolEnum, ExceptionConstant.AN_UNSUPPORTED_PROTOCOL, req.getProtocal());
|
||||
if (networkProtocolEnum != NetworkProtocolEnum.HTTP) {
|
||||
// 目前仅HTTP支持绑定域名
|
||||
req.setSubdomain("");
|
||||
}
|
||||
|
||||
return portMappingService.create(req);
|
||||
}
|
||||
@@ -47,6 +58,20 @@ public class PortMappingController {
|
||||
@Mapping("/update")
|
||||
public PortMappingUpdateRes update(PortMappingUpdateReq req) {
|
||||
ParamCheckUtil.checkNotNull(req, "req");
|
||||
ParamCheckUtil.checkNotNull(req.getLicenseId(), "licenseId");
|
||||
ParamCheckUtil.checkNotNull(req.getServerPort(), "serverPort");
|
||||
ParamCheckUtil.checkNotNull(req.getClientPort(), "clientPort");
|
||||
ParamCheckUtil.checkNotEmpty(req.getProtocal(), "protocal");
|
||||
if (StringUtils.isBlank(req.getClientIp())) {
|
||||
// 没传客户端ip,默认为127.0.0.1
|
||||
req.setClientIp("127.0.0.1");
|
||||
}
|
||||
NetworkProtocolEnum networkProtocolEnum = NetworkProtocolEnum.of(req.getProtocal());
|
||||
ParamCheckUtil.checkNotNull(networkProtocolEnum, ExceptionConstant.AN_UNSUPPORTED_PROTOCOL, req.getProtocal());
|
||||
if (networkProtocolEnum != NetworkProtocolEnum.HTTP) {
|
||||
// 目前仅HTTP支持绑定域名
|
||||
req.setSubdomain("");
|
||||
}
|
||||
|
||||
return portMappingService.update(req);
|
||||
}
|
||||
@@ -19,15 +19,17 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.controller;
|
||||
package org.dromara.neutrinoproxy.server.controller;
|
||||
|
||||
import fun.asgc.neutrino.proxy.server.base.page.PageInfo;
|
||||
import fun.asgc.neutrino.proxy.server.base.page.PageQuery;
|
||||
import fun.asgc.neutrino.proxy.server.base.rest.Authorization;
|
||||
import fun.asgc.neutrino.proxy.server.controller.req.system.*;
|
||||
import fun.asgc.neutrino.proxy.server.controller.res.system.*;
|
||||
import fun.asgc.neutrino.proxy.server.service.PortPoolService;
|
||||
import fun.asgc.neutrino.proxy.server.util.ParamCheckUtil;
|
||||
import org.dromara.neutrinoproxy.server.base.page.PageInfo;
|
||||
import org.dromara.neutrinoproxy.server.base.page.PageQuery;
|
||||
import org.dromara.neutrinoproxy.server.base.rest.Authorization;
|
||||
import org.dromara.neutrinoproxy.server.controller.req.system.*;
|
||||
import org.dromara.neutrinoproxy.server.controller.res.system.*;
|
||||
import org.dromara.neutrinoproxy.server.service.PortPoolService;
|
||||
import org.dromara.neutrinoproxy.server.util.ParamCheckUtil;
|
||||
import org.dromara.neutrinoproxy.server.controller.req.system.*;
|
||||
import org.dromara.neutrinoproxy.server.controller.res.system.*;
|
||||
import org.noear.solon.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
@@ -71,7 +73,7 @@ public class PortPoolController {
|
||||
@Authorization(onlyAdmin = true)
|
||||
public PortPoolCreateRes create(PortPoolCreateReq req) {
|
||||
ParamCheckUtil.checkNotNull(req, "req");
|
||||
ParamCheckUtil.checkNotNull(req.getPort(), "port");
|
||||
ParamCheckUtil.checkNotEmpty(req.getPort(), "port");
|
||||
ParamCheckUtil.checkNotNull(req.getGroupId(), "groupId");
|
||||
|
||||
return portPoolService.create(req);
|
||||
@@ -0,0 +1,40 @@
|
||||
package org.dromara.neutrinoproxy.server.controller;
|
||||
|
||||
import org.dromara.neutrinoproxy.server.base.page.PageInfo;
|
||||
import org.dromara.neutrinoproxy.server.base.page.PageQuery;
|
||||
import org.dromara.neutrinoproxy.server.controller.res.system.ProtocalListRes;
|
||||
import org.dromara.neutrinoproxy.server.service.ProtocalService;
|
||||
import org.dromara.neutrinoproxy.server.util.ParamCheckUtil;
|
||||
import org.noear.solon.annotation.Controller;
|
||||
import org.noear.solon.annotation.Get;
|
||||
import org.noear.solon.annotation.Inject;
|
||||
import org.noear.solon.annotation.Mapping;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author: aoshiguchen
|
||||
* @date: 2023/4/2
|
||||
*/
|
||||
@Mapping("/protocal")
|
||||
@Controller
|
||||
public class ProtocalController {
|
||||
|
||||
@Inject
|
||||
private ProtocalService protocalService;
|
||||
|
||||
@Get
|
||||
@Mapping("/page")
|
||||
public PageInfo<ProtocalListRes> page(PageQuery pageQuery) {
|
||||
ParamCheckUtil.checkNotNull(pageQuery, "pageQuery");
|
||||
|
||||
List<ProtocalListRes> list = protocalService.list();
|
||||
return PageInfo.of(protocalService.list(), (long)list.size(), pageQuery.getCurrent(), pageQuery.getSize());
|
||||
}
|
||||
|
||||
@Get
|
||||
@Mapping("/list")
|
||||
public List<ProtocalListRes> list() {
|
||||
return protocalService.list();
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,15 @@
|
||||
package fun.asgc.neutrino.proxy.server.controller;
|
||||
package org.dromara.neutrinoproxy.server.controller;
|
||||
|
||||
import fun.asgc.neutrino.proxy.server.base.page.PageInfo;
|
||||
import fun.asgc.neutrino.proxy.server.base.page.PageQuery;
|
||||
import fun.asgc.neutrino.proxy.server.controller.req.report.LicenseFlowMonthReportReq;
|
||||
import fun.asgc.neutrino.proxy.server.controller.req.report.LicenseFlowReportReq;
|
||||
import fun.asgc.neutrino.proxy.server.controller.req.report.UserFlowMonthReportReq;
|
||||
import fun.asgc.neutrino.proxy.server.controller.req.report.UserFlowReportReq;
|
||||
import fun.asgc.neutrino.proxy.server.controller.res.report.*;
|
||||
import fun.asgc.neutrino.proxy.server.service.ReportService;
|
||||
import fun.asgc.neutrino.proxy.server.util.ParamCheckUtil;
|
||||
import org.dromara.neutrinoproxy.server.base.page.PageInfo;
|
||||
import org.dromara.neutrinoproxy.server.base.page.PageQuery;
|
||||
import org.dromara.neutrinoproxy.server.controller.req.report.LicenseFlowMonthReportReq;
|
||||
import org.dromara.neutrinoproxy.server.controller.req.report.LicenseFlowReportReq;
|
||||
import org.dromara.neutrinoproxy.server.controller.req.report.UserFlowMonthReportReq;
|
||||
import org.dromara.neutrinoproxy.server.controller.req.report.UserFlowReportReq;
|
||||
import org.dromara.neutrinoproxy.server.controller.res.report.*;
|
||||
import org.dromara.neutrinoproxy.server.controller.res.report.*;
|
||||
import org.dromara.neutrinoproxy.server.service.ReportService;
|
||||
import org.dromara.neutrinoproxy.server.util.ParamCheckUtil;
|
||||
import org.noear.solon.annotation.Controller;
|
||||
import org.noear.solon.annotation.Get;
|
||||
import org.noear.solon.annotation.Inject;
|
||||
@@ -19,20 +19,22 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.controller;
|
||||
package org.dromara.neutrinoproxy.server.controller;
|
||||
|
||||
import fun.asgc.neutrino.proxy.server.base.page.PageInfo;
|
||||
import fun.asgc.neutrino.proxy.server.base.page.PageQuery;
|
||||
import fun.asgc.neutrino.proxy.server.base.rest.Authorization;
|
||||
import fun.asgc.neutrino.proxy.server.base.rest.SystemContextHolder;
|
||||
import fun.asgc.neutrino.proxy.server.constant.ExceptionConstant;
|
||||
import fun.asgc.neutrino.proxy.server.controller.req.system.*;
|
||||
import fun.asgc.neutrino.proxy.server.controller.res.system.*;
|
||||
import fun.asgc.neutrino.proxy.server.dal.UserMapper;
|
||||
import fun.asgc.neutrino.proxy.server.dal.entity.UserDO;
|
||||
import fun.asgc.neutrino.proxy.server.service.UserService;
|
||||
import fun.asgc.neutrino.proxy.server.util.Md5Util;
|
||||
import fun.asgc.neutrino.proxy.server.util.ParamCheckUtil;
|
||||
import org.dromara.neutrinoproxy.server.base.page.PageInfo;
|
||||
import org.dromara.neutrinoproxy.server.base.page.PageQuery;
|
||||
import org.dromara.neutrinoproxy.server.base.rest.Authorization;
|
||||
import org.dromara.neutrinoproxy.server.base.rest.SystemContextHolder;
|
||||
import org.dromara.neutrinoproxy.server.constant.ExceptionConstant;
|
||||
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.dal.UserMapper;
|
||||
import org.dromara.neutrinoproxy.server.dal.entity.UserDO;
|
||||
import org.dromara.neutrinoproxy.server.service.UserService;
|
||||
import org.dromara.neutrinoproxy.server.util.Md5Util;
|
||||
import org.dromara.neutrinoproxy.server.util.ParamCheckUtil;
|
||||
import org.dromara.neutrinoproxy.server.controller.req.system.*;
|
||||
import org.noear.solon.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
@@ -19,14 +19,14 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.controller;
|
||||
package org.dromara.neutrinoproxy.server.controller;
|
||||
|
||||
import fun.asgc.neutrino.proxy.server.base.page.PageInfo;
|
||||
import fun.asgc.neutrino.proxy.server.base.page.PageQuery;
|
||||
import fun.asgc.neutrino.proxy.server.controller.req.log.UserLoginRecordListReq;
|
||||
import fun.asgc.neutrino.proxy.server.controller.res.log.UserLoginRecordListRes;
|
||||
import fun.asgc.neutrino.proxy.server.service.UserLoginRecordService;
|
||||
import fun.asgc.neutrino.proxy.server.util.ParamCheckUtil;
|
||||
import org.dromara.neutrinoproxy.server.base.page.PageInfo;
|
||||
import org.dromara.neutrinoproxy.server.base.page.PageQuery;
|
||||
import org.dromara.neutrinoproxy.server.controller.req.log.UserLoginRecordListReq;
|
||||
import org.dromara.neutrinoproxy.server.controller.res.log.UserLoginRecordListRes;
|
||||
import org.dromara.neutrinoproxy.server.service.UserLoginRecordService;
|
||||
import org.dromara.neutrinoproxy.server.util.ParamCheckUtil;
|
||||
import org.noear.solon.annotation.Controller;
|
||||
import org.noear.solon.annotation.Get;
|
||||
import org.noear.solon.annotation.Inject;
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.controller.req.log;
|
||||
package org.dromara.neutrinoproxy.server.controller.req.log;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.controller.req.log;
|
||||
package org.dromara.neutrinoproxy.server.controller.req.log;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.controller.req.log;
|
||||
package org.dromara.neutrinoproxy.server.controller.req.log;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.controller.req.proxy;
|
||||
package org.dromara.neutrinoproxy.server.controller.req.proxy;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package fun.asgc.neutrino.proxy.server.controller.req.proxy;
|
||||
package org.dromara.neutrinoproxy.server.controller.req.proxy;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package fun.asgc.neutrino.proxy.server.controller.req.proxy;
|
||||
package org.dromara.neutrinoproxy.server.controller.req.proxy;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.controller.req.proxy;
|
||||
package org.dromara.neutrinoproxy.server.controller.req.proxy;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package fun.asgc.neutrino.proxy.server.controller.req.proxy;
|
||||
package org.dromara.neutrinoproxy.server.controller.req.proxy;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -19,9 +19,10 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.controller.req.proxy;
|
||||
package org.dromara.neutrinoproxy.server.controller.req.proxy;
|
||||
|
||||
import lombok.Data;
|
||||
import org.dromara.neutrinoproxy.server.constant.EnableStatusEnum;
|
||||
|
||||
/**
|
||||
* 更新启用状态请求
|
||||
@@ -36,7 +37,7 @@ public class LicenseUpdateEnableStatusReq {
|
||||
private Integer id;
|
||||
/**
|
||||
* 启用状态
|
||||
* {@link fun.asgc.neutrino.proxy.server.constant.EnableStatusEnum}
|
||||
* {@link EnableStatusEnum}
|
||||
*/
|
||||
private Integer enable;
|
||||
}
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.controller.req.proxy;
|
||||
package org.dromara.neutrinoproxy.server.controller.req.proxy;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.controller.req.proxy;
|
||||
package org.dromara.neutrinoproxy.server.controller.req.proxy;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -34,6 +34,14 @@ public class PortMappingCreateReq {
|
||||
* licenseId
|
||||
*/
|
||||
private Integer licenseId;
|
||||
/**
|
||||
* 协议
|
||||
*/
|
||||
private String protocal;
|
||||
/**
|
||||
* 子域名
|
||||
*/
|
||||
private String subdomain;
|
||||
/**
|
||||
* 服务端端口
|
||||
*/
|
||||
@@ -1,4 +1,4 @@
|
||||
package fun.asgc.neutrino.proxy.server.controller.req.proxy;
|
||||
package org.dromara.neutrinoproxy.server.controller.req.proxy;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.controller.req.proxy;
|
||||
package org.dromara.neutrinoproxy.server.controller.req.proxy;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -19,9 +19,10 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.controller.req.proxy;
|
||||
package org.dromara.neutrinoproxy.server.controller.req.proxy;
|
||||
|
||||
import fun.asgc.neutrino.proxy.server.constant.OnlineStatusEnum;
|
||||
import org.dromara.neutrinoproxy.server.constant.EnableStatusEnum;
|
||||
import org.dromara.neutrinoproxy.server.constant.OnlineStatusEnum;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
@@ -35,6 +36,10 @@ public class PortMappingListReq {
|
||||
* 用户ID
|
||||
*/
|
||||
private Integer userId;
|
||||
/**
|
||||
* 协议
|
||||
*/
|
||||
private String protocal;
|
||||
/**
|
||||
* licenseId
|
||||
*/
|
||||
@@ -51,7 +56,7 @@ public class PortMappingListReq {
|
||||
private Integer isOnline;
|
||||
/**
|
||||
* 启用状态
|
||||
* {@link fun.asgc.neutrino.proxy.server.constant.EnableStatusEnum}
|
||||
* {@link EnableStatusEnum}
|
||||
*/
|
||||
private Integer enable;
|
||||
}
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.controller.req.proxy;
|
||||
package org.dromara.neutrinoproxy.server.controller.req.proxy;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.controller.req.proxy;
|
||||
package org.dromara.neutrinoproxy.server.controller.req.proxy;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -38,6 +38,14 @@ public class PortMappingUpdateReq {
|
||||
* licenseId
|
||||
*/
|
||||
private Integer licenseId;
|
||||
/**
|
||||
* 协议
|
||||
*/
|
||||
private String protocal;
|
||||
/**
|
||||
* 子域名
|
||||
*/
|
||||
private String subdomain;
|
||||
/**
|
||||
* 服务端端口
|
||||
*/
|
||||
@@ -1,4 +1,4 @@
|
||||
package fun.asgc.neutrino.proxy.server.controller.req.report;
|
||||
package org.dromara.neutrinoproxy.server.controller.req.report;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package fun.asgc.neutrino.proxy.server.controller.req.report;
|
||||
package org.dromara.neutrinoproxy.server.controller.req.report;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package fun.asgc.neutrino.proxy.server.controller.req.report;
|
||||
package org.dromara.neutrinoproxy.server.controller.req.report;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package fun.asgc.neutrino.proxy.server.controller.req.report;
|
||||
package org.dromara.neutrinoproxy.server.controller.req.report;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package fun.asgc.neutrino.proxy.server.controller.req.system;
|
||||
package org.dromara.neutrinoproxy.server.controller.req.system;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.controller.req.system;
|
||||
package org.dromara.neutrinoproxy.server.controller.req.system;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.controller.req.system;
|
||||
package org.dromara.neutrinoproxy.server.controller.req.system;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.controller.req.system;
|
||||
package org.dromara.neutrinoproxy.server.controller.req.system;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -19,9 +19,10 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.controller.req.system;
|
||||
package org.dromara.neutrinoproxy.server.controller.req.system;
|
||||
|
||||
import lombok.Data;
|
||||
import org.dromara.neutrinoproxy.server.constant.EnableStatusEnum;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@@ -59,7 +60,7 @@ public class JobInfoUpdateReq {
|
||||
private String alarmDing;
|
||||
/**
|
||||
* 启用状态
|
||||
* {@link fun.asgc.neutrino.proxy.server.constant.EnableStatusEnum}
|
||||
* {@link EnableStatusEnum}
|
||||
*/
|
||||
private Integer enable;
|
||||
/**
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.controller.req.system;
|
||||
package org.dromara.neutrinoproxy.server.controller.req.system;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.controller.req.system;
|
||||
package org.dromara.neutrinoproxy.server.controller.req.system;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package fun.asgc.neutrino.proxy.server.controller.req.system;
|
||||
package org.dromara.neutrinoproxy.server.controller.req.system;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package fun.asgc.neutrino.proxy.server.controller.req.system;
|
||||
package org.dromara.neutrinoproxy.server.controller.req.system;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package fun.asgc.neutrino.proxy.server.controller.req.system;
|
||||
package org.dromara.neutrinoproxy.server.controller.req.system;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package fun.asgc.neutrino.proxy.server.controller.req.system;
|
||||
package org.dromara.neutrinoproxy.server.controller.req.system;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.controller.req.system;
|
||||
package org.dromara.neutrinoproxy.server.controller.req.system;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -30,7 +30,7 @@ import lombok.Data;
|
||||
*/
|
||||
@Data
|
||||
public class PortPoolCreateReq {
|
||||
private Integer port;
|
||||
private String port;
|
||||
|
||||
private Integer groupId;
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package fun.asgc.neutrino.proxy.server.controller.req.system;
|
||||
package org.dromara.neutrinoproxy.server.controller.req.system;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.controller.req.system;
|
||||
package org.dromara.neutrinoproxy.server.controller.req.system;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.controller.req.system;
|
||||
package org.dromara.neutrinoproxy.server.controller.req.system;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package fun.asgc.neutrino.proxy.server.controller.req.system;
|
||||
package org.dromara.neutrinoproxy.server.controller.req.system;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package fun.asgc.neutrino.proxy.server.controller.req.system;
|
||||
package org.dromara.neutrinoproxy.server.controller.req.system;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.controller.req.system;
|
||||
package org.dromara.neutrinoproxy.server.controller.req.system;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package fun.asgc.neutrino.proxy.server.controller.req.system;
|
||||
package org.dromara.neutrinoproxy.server.controller.req.system;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.controller.req.system;
|
||||
package org.dromara.neutrinoproxy.server.controller.req.system;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.controller.req.system;
|
||||
package org.dromara.neutrinoproxy.server.controller.req.system;
|
||||
|
||||
/**
|
||||
* 用户列表请求
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.controller.req.system;
|
||||
package org.dromara.neutrinoproxy.server.controller.req.system;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.controller.req.system;
|
||||
package org.dromara.neutrinoproxy.server.controller.req.system;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.controller.req.system;
|
||||
package org.dromara.neutrinoproxy.server.controller.req.system;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.controller.res.log;
|
||||
package org.dromara.neutrinoproxy.server.controller.res.log;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -19,9 +19,10 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.controller.res.log;
|
||||
package org.dromara.neutrinoproxy.server.controller.res.log;
|
||||
|
||||
import lombok.Data;
|
||||
import org.dromara.neutrinoproxy.server.constant.AlarmStatusEnum;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@@ -55,7 +56,7 @@ public class JobLogListRes {
|
||||
private String msg;
|
||||
/**
|
||||
* 报警状态
|
||||
* {@link fun.asgc.neutrino.proxy.server.constant.AlarmStatusEnum}
|
||||
* {@link AlarmStatusEnum}
|
||||
*/
|
||||
private Integer alarmStatus;
|
||||
/**
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.controller.res.log;
|
||||
package org.dromara.neutrinoproxy.server.controller.res.log;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.controller.res.proxy;
|
||||
package org.dromara.neutrinoproxy.server.controller.res.proxy;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -19,9 +19,10 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.controller.res.proxy;
|
||||
package org.dromara.neutrinoproxy.server.controller.res.proxy;
|
||||
|
||||
import fun.asgc.neutrino.proxy.server.constant.OnlineStatusEnum;
|
||||
import org.dromara.neutrinoproxy.server.constant.EnableStatusEnum;
|
||||
import org.dromara.neutrinoproxy.server.constant.OnlineStatusEnum;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@@ -59,7 +60,7 @@ public class LicenseDetailRes {
|
||||
private Integer isOnline;
|
||||
/**
|
||||
* 启用状态
|
||||
* {@link fun.asgc.neutrino.proxy.server.constant.EnableStatusEnum}
|
||||
* {@link EnableStatusEnum}
|
||||
*/
|
||||
private Integer enable;
|
||||
/**
|
||||
@@ -1,6 +1,7 @@
|
||||
package fun.asgc.neutrino.proxy.server.controller.res.proxy;
|
||||
package org.dromara.neutrinoproxy.server.controller.res.proxy;
|
||||
|
||||
import fun.asgc.neutrino.proxy.server.constant.OnlineStatusEnum;
|
||||
import org.dromara.neutrinoproxy.server.constant.EnableStatusEnum;
|
||||
import org.dromara.neutrinoproxy.server.constant.OnlineStatusEnum;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@@ -38,7 +39,7 @@ public class LicenseListRes {
|
||||
private Integer isOnline;
|
||||
/**
|
||||
* 启用状态
|
||||
* {@link fun.asgc.neutrino.proxy.server.constant.EnableStatusEnum}
|
||||
* {@link EnableStatusEnum}
|
||||
*/
|
||||
private Integer enable;
|
||||
/**
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.controller.res.proxy;
|
||||
package org.dromara.neutrinoproxy.server.controller.res.proxy;
|
||||
|
||||
/**
|
||||
* 更新启用状态响应
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.controller.res.proxy;
|
||||
package org.dromara.neutrinoproxy.server.controller.res.proxy;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.controller.res.proxy;
|
||||
package org.dromara.neutrinoproxy.server.controller.res.proxy;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package fun.asgc.neutrino.proxy.server.controller.res.proxy;
|
||||
package org.dromara.neutrinoproxy.server.controller.res.proxy;
|
||||
|
||||
import fun.asgc.neutrino.proxy.server.constant.OnlineStatusEnum;
|
||||
import org.dromara.neutrinoproxy.server.constant.EnableStatusEnum;
|
||||
import org.dromara.neutrinoproxy.server.constant.OnlineStatusEnum;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@@ -50,7 +51,7 @@ public class PortMappingDetailRes {
|
||||
private Integer isOnline;
|
||||
/**
|
||||
* 启用状态
|
||||
* {@link fun.asgc.neutrino.proxy.server.constant.EnableStatusEnum}
|
||||
* {@link EnableStatusEnum}
|
||||
*/
|
||||
private Integer enable;
|
||||
/**
|
||||
@@ -19,9 +19,10 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.controller.res.proxy;
|
||||
package org.dromara.neutrinoproxy.server.controller.res.proxy;
|
||||
|
||||
import fun.asgc.neutrino.proxy.server.constant.OnlineStatusEnum;
|
||||
import org.dromara.neutrinoproxy.server.constant.EnableStatusEnum;
|
||||
import org.dromara.neutrinoproxy.server.constant.OnlineStatusEnum;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
@@ -38,6 +39,18 @@ public class PortMappingListRes {
|
||||
* licenseId
|
||||
*/
|
||||
private Integer licenseId;
|
||||
/**
|
||||
* 协议
|
||||
*/
|
||||
private String protocal;
|
||||
/**
|
||||
* 子域名
|
||||
*/
|
||||
private String subdomain;
|
||||
/**
|
||||
* 域名
|
||||
*/
|
||||
private String domain;
|
||||
/**
|
||||
* license名称
|
||||
*/
|
||||
@@ -73,7 +86,7 @@ public class PortMappingListRes {
|
||||
private Integer isOnline;
|
||||
/**
|
||||
* 启用状态
|
||||
* {@link fun.asgc.neutrino.proxy.server.constant.EnableStatusEnum}
|
||||
* {@link EnableStatusEnum}
|
||||
*/
|
||||
private Integer enable;
|
||||
/**
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.controller.res.proxy;
|
||||
package org.dromara.neutrinoproxy.server.controller.res.proxy;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.controller.res.proxy;
|
||||
package org.dromara.neutrinoproxy.server.controller.res.proxy;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package fun.asgc.neutrino.proxy.server.controller.res.report;
|
||||
package org.dromara.neutrinoproxy.server.controller.res.report;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
@@ -1,4 +1,4 @@
|
||||
package fun.asgc.neutrino.proxy.server.controller.res.report;
|
||||
package org.dromara.neutrinoproxy.server.controller.res.report;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
@@ -1,4 +1,4 @@
|
||||
package fun.asgc.neutrino.proxy.server.controller.res.report;
|
||||
package org.dromara.neutrinoproxy.server.controller.res.report;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
@@ -1,4 +1,4 @@
|
||||
package fun.asgc.neutrino.proxy.server.controller.res.report;
|
||||
package org.dromara.neutrinoproxy.server.controller.res.report;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
@@ -1,4 +1,4 @@
|
||||
package fun.asgc.neutrino.proxy.server.controller.res.report;
|
||||
package org.dromara.neutrinoproxy.server.controller.res.report;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
@@ -1,4 +1,4 @@
|
||||
package fun.asgc.neutrino.proxy.server.controller.res.system;
|
||||
package org.dromara.neutrinoproxy.server.controller.res.system;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.controller.res.system;
|
||||
package org.dromara.neutrinoproxy.server.controller.res.system;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -19,9 +19,11 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.controller.res.system;
|
||||
package org.dromara.neutrinoproxy.server.controller.res.system;
|
||||
|
||||
import lombok.Data;
|
||||
import org.dromara.neutrinoproxy.server.constant.EnableStatusEnum;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
@@ -58,7 +60,7 @@ public class JobInfoListRes {
|
||||
private String alarmDing;
|
||||
/**
|
||||
* 启用状态
|
||||
* {@link fun.asgc.neutrino.proxy.server.constant.EnableStatusEnum}
|
||||
* {@link EnableStatusEnum}
|
||||
*/
|
||||
private Integer enable;
|
||||
/**
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.controller.res.system;
|
||||
package org.dromara.neutrinoproxy.server.controller.res.system;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.controller.res.system;
|
||||
package org.dromara.neutrinoproxy.server.controller.res.system;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.controller.res.system;
|
||||
package org.dromara.neutrinoproxy.server.controller.res.system;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.controller.res.system;
|
||||
package org.dromara.neutrinoproxy.server.controller.res.system;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
@@ -0,0 +1,4 @@
|
||||
package org.dromara.neutrinoproxy.server.controller.res.system;
|
||||
|
||||
public class PortGroupCreateRes {
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package fun.asgc.neutrino.proxy.server.controller.res.system;
|
||||
package org.dromara.neutrinoproxy.server.controller.res.system;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
@@ -1,4 +1,4 @@
|
||||
package fun.asgc.neutrino.proxy.server.controller.res.system;
|
||||
package org.dromara.neutrinoproxy.server.controller.res.system;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.controller.res.system;
|
||||
package org.dromara.neutrinoproxy.server.controller.res.system;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -19,9 +19,10 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.controller.res.system;
|
||||
package org.dromara.neutrinoproxy.server.controller.res.system;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@@ -30,6 +31,7 @@ import java.util.Date;
|
||||
* @author: aoshiguchen
|
||||
* @date: 2022/8/7
|
||||
*/
|
||||
@Accessors(chain = true)
|
||||
@Data
|
||||
public class PortPoolListRes {
|
||||
private Integer id;
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.controller.res.system;
|
||||
package org.dromara.neutrinoproxy.server.controller.res.system;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
package org.dromara.neutrinoproxy.server.controller.res.system;
|
||||
|
||||
public class PortPoolUpdateGroupRes {
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package fun.asgc.neutrino.proxy.server.controller.res.system;
|
||||
package org.dromara.neutrinoproxy.server.controller.res.system;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package org.dromara.neutrinoproxy.server.controller.res.system;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 协议列表响应
|
||||
* @author: aoshiguchen
|
||||
* @date: 2023/4/2
|
||||
*/
|
||||
@Accessors(chain = true)
|
||||
@Data
|
||||
public class ProtocalListRes {
|
||||
/**
|
||||
* 协议名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 启用状态
|
||||
*/
|
||||
private Boolean enable;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
}
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.controller.res.system;
|
||||
package org.dromara.neutrinoproxy.server.controller.res.system;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -1,4 +1,4 @@
|
||||
package fun.asgc.neutrino.proxy.server.controller.res.system;
|
||||
package org.dromara.neutrinoproxy.server.controller.res.system;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.controller.res.system;
|
||||
package org.dromara.neutrinoproxy.server.controller.res.system;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.controller.res.system;
|
||||
package org.dromara.neutrinoproxy.server.controller.res.system;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.controller.res.system;
|
||||
package org.dromara.neutrinoproxy.server.controller.res.system;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.controller.res.system;
|
||||
package org.dromara.neutrinoproxy.server.controller.res.system;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -1,8 +1,8 @@
|
||||
package fun.asgc.neutrino.proxy.server.dal;
|
||||
package org.dromara.neutrinoproxy.server.dal;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import fun.asgc.neutrino.proxy.server.dal.entity.ClientConnectRecordDO;
|
||||
import org.dromara.neutrinoproxy.server.dal.entity.ClientConnectRecordDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.Date;
|
||||
@@ -19,11 +19,11 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.dal;
|
||||
package org.dromara.neutrinoproxy.server.dal;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import fun.asgc.neutrino.proxy.server.dal.entity.FlowReportDayDO;
|
||||
import org.dromara.neutrinoproxy.server.dal.entity.FlowReportDayDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.Date;
|
||||
@@ -19,11 +19,11 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.dal;
|
||||
package org.dromara.neutrinoproxy.server.dal;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import fun.asgc.neutrino.proxy.server.dal.entity.FlowReportHourDO;
|
||||
import org.dromara.neutrinoproxy.server.dal.entity.FlowReportHourDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.Date;
|
||||
@@ -19,11 +19,11 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.dal;
|
||||
package org.dromara.neutrinoproxy.server.dal;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import fun.asgc.neutrino.proxy.server.dal.entity.FlowReportMinuteDO;
|
||||
import org.dromara.neutrinoproxy.server.dal.entity.FlowReportMinuteDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.Date;
|
||||
@@ -19,11 +19,11 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.dal;
|
||||
package org.dromara.neutrinoproxy.server.dal;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import fun.asgc.neutrino.proxy.server.dal.entity.FlowReportMonthDO;
|
||||
import org.dromara.neutrinoproxy.server.dal.entity.FlowReportMonthDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
@@ -19,12 +19,12 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.dal;
|
||||
package org.dromara.neutrinoproxy.server.dal;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import fun.asgc.neutrino.proxy.server.dal.entity.JobInfoDO;
|
||||
import org.dromara.neutrinoproxy.server.dal.entity.JobInfoDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.Date;
|
||||
@@ -19,11 +19,11 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.dal;
|
||||
package org.dromara.neutrinoproxy.server.dal;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import fun.asgc.neutrino.proxy.server.dal.entity.JobLogDO;
|
||||
import org.dromara.neutrinoproxy.server.dal.entity.JobLogDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.Date;
|
||||
@@ -19,12 +19,12 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.dal;
|
||||
package org.dromara.neutrinoproxy.server.dal;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import fun.asgc.neutrino.proxy.server.dal.entity.LicenseDO;
|
||||
import org.dromara.neutrinoproxy.server.dal.entity.LicenseDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.Date;
|
||||
@@ -72,7 +72,7 @@ public interface LicenseMapper extends BaseMapper<LicenseDO> {
|
||||
|
||||
default void updateOnlineStatus(Integer isOnline, Date updateTime) {
|
||||
this.update(null, new LambdaUpdateWrapper<LicenseDO>()
|
||||
.set(LicenseDO::getIsOnline, updateTime)
|
||||
.set(LicenseDO::getIsOnline, isOnline)
|
||||
.set(LicenseDO::getUpdateTime, updateTime)
|
||||
);
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
package fun.asgc.neutrino.proxy.server.dal;
|
||||
package org.dromara.neutrinoproxy.server.dal;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import fun.asgc.neutrino.proxy.server.controller.req.system.PortGroupListReq;
|
||||
import fun.asgc.neutrino.proxy.server.controller.res.system.PortGroupListRes;
|
||||
import fun.asgc.neutrino.proxy.server.dal.entity.PortGroupDO;
|
||||
import org.dromara.neutrinoproxy.server.controller.req.system.PortGroupListReq;
|
||||
import org.dromara.neutrinoproxy.server.controller.res.system.PortGroupListRes;
|
||||
import org.dromara.neutrinoproxy.server.dal.entity.PortGroupDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.Date;
|
||||
@@ -1,12 +1,12 @@
|
||||
package fun.asgc.neutrino.proxy.server.dal;
|
||||
package org.dromara.neutrinoproxy.server.dal;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import fun.asgc.neutrino.proxy.server.constant.EnableStatusEnum;
|
||||
import fun.asgc.neutrino.proxy.server.controller.req.proxy.PortMappingListReq;
|
||||
import fun.asgc.neutrino.proxy.server.dal.entity.PortMappingDO;
|
||||
import org.dromara.neutrinoproxy.server.constant.EnableStatusEnum;
|
||||
import org.dromara.neutrinoproxy.server.controller.req.proxy.PortMappingListReq;
|
||||
import org.dromara.neutrinoproxy.server.dal.entity.PortMappingDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@@ -42,6 +42,18 @@ public interface PortMappingMapper extends BaseMapper<PortMappingDO> {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验子域名是否重复
|
||||
* @param subdomain
|
||||
* @return
|
||||
*/
|
||||
default Boolean checkRepeatBySubdomain(String subdomain, Set<Integer> excludeIds) {
|
||||
return this.selectCount(new LambdaQueryWrapper<PortMappingDO>()
|
||||
.eq(PortMappingDO::getSubdomain, subdomain)
|
||||
.notIn(!CollectionUtil.isEmpty(excludeIds), PortMappingDO::getId, excludeIds)
|
||||
).intValue() > 0;
|
||||
}
|
||||
|
||||
default List<PortMappingDO> findEnableListByLicenseId(Integer licenseId) {
|
||||
return this.selectList(new LambdaQueryWrapper<PortMappingDO>()
|
||||
.eq(PortMappingDO::getLicenseId, licenseId)
|
||||
@@ -19,14 +19,14 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.dal;
|
||||
package org.dromara.neutrinoproxy.server.dal;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import fun.asgc.neutrino.proxy.server.controller.req.system.PortPoolListReq;
|
||||
import fun.asgc.neutrino.proxy.server.controller.res.system.PortPoolListRes;
|
||||
import fun.asgc.neutrino.proxy.server.dal.entity.PortPoolDO;
|
||||
import org.dromara.neutrinoproxy.server.controller.req.system.PortPoolListReq;
|
||||
import org.dromara.neutrinoproxy.server.controller.res.system.PortPoolListRes;
|
||||
import org.dromara.neutrinoproxy.server.dal.entity.PortPoolDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
package fun.asgc.neutrino.proxy.server.dal;
|
||||
package org.dromara.neutrinoproxy.server.dal;
|
||||
|
||||
import fun.asgc.neutrino.proxy.server.controller.res.report.*;
|
||||
import fun.asgc.neutrino.proxy.server.service.bo.FlowBO;
|
||||
import fun.asgc.neutrino.proxy.server.service.bo.SingleDayFlowBO;
|
||||
import org.dromara.neutrinoproxy.server.controller.res.report.*;
|
||||
import org.dromara.neutrinoproxy.server.controller.res.report.LicenseFlowMonthReportRes;
|
||||
import org.dromara.neutrinoproxy.server.controller.res.report.LicenseFlowReportRes;
|
||||
import org.dromara.neutrinoproxy.server.controller.res.report.UserFlowMonthReportRes;
|
||||
import org.dromara.neutrinoproxy.server.controller.res.report.UserFlowReportRes;
|
||||
import org.dromara.neutrinoproxy.server.service.bo.FlowBO;
|
||||
import org.dromara.neutrinoproxy.server.service.bo.SingleDayFlowBO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@@ -19,11 +19,11 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.dal;
|
||||
package org.dromara.neutrinoproxy.server.dal;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import fun.asgc.neutrino.proxy.server.dal.entity.UserLoginRecordDO;
|
||||
import org.dromara.neutrinoproxy.server.dal.entity.UserLoginRecordDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.Date;
|
||||
@@ -1,9 +1,9 @@
|
||||
package fun.asgc.neutrino.proxy.server.dal;
|
||||
package org.dromara.neutrinoproxy.server.dal;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import fun.asgc.neutrino.proxy.server.dal.entity.UserDO;
|
||||
import org.dromara.neutrinoproxy.server.dal.entity.UserDO;
|
||||
import org.apache.ibatis.annotations.Insert;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@@ -19,12 +19,12 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.dal;
|
||||
package org.dromara.neutrinoproxy.server.dal;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import fun.asgc.neutrino.proxy.server.dal.entity.UserTokenDO;
|
||||
import org.dromara.neutrinoproxy.server.dal.entity.UserTokenDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.Date;
|
||||
@@ -1,4 +1,4 @@
|
||||
package fun.asgc.neutrino.proxy.server.dal.entity;
|
||||
package org.dromara.neutrinoproxy.server.dal.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.dal.entity;
|
||||
package org.dromara.neutrinoproxy.server.dal.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.dal.entity;
|
||||
package org.dromara.neutrinoproxy.server.dal.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.dal.entity;
|
||||
package org.dromara.neutrinoproxy.server.dal.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.dal.entity;
|
||||
package org.dromara.neutrinoproxy.server.dal.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.dal.entity;
|
||||
package org.dromara.neutrinoproxy.server.dal.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
@@ -28,6 +28,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.dromara.neutrinoproxy.server.constant.EnableStatusEnum;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@@ -52,7 +53,7 @@ public class JobInfoDO {
|
||||
private String param;
|
||||
/**
|
||||
* 启用状态
|
||||
* {@link fun.asgc.neutrino.proxy.server.constant.EnableStatusEnum}
|
||||
* {@link EnableStatusEnum}
|
||||
*/
|
||||
private Integer enable;
|
||||
/**
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.dal.entity;
|
||||
package org.dromara.neutrinoproxy.server.dal.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
@@ -19,13 +19,14 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.dal.entity;
|
||||
package org.dromara.neutrinoproxy.server.dal.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import fun.asgc.neutrino.proxy.server.constant.OnlineStatusEnum;
|
||||
import org.dromara.neutrinoproxy.server.constant.EnableStatusEnum;
|
||||
import org.dromara.neutrinoproxy.server.constant.OnlineStatusEnum;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.Accessors;
|
||||
@@ -64,7 +65,7 @@ public class LicenseDO {
|
||||
private Integer isOnline;
|
||||
/**
|
||||
* 启用状态
|
||||
* {@link fun.asgc.neutrino.proxy.server.constant.EnableStatusEnum}
|
||||
* {@link EnableStatusEnum}
|
||||
*/
|
||||
private Integer enable;
|
||||
/**
|
||||
@@ -1,4 +1,4 @@
|
||||
package fun.asgc.neutrino.proxy.server.dal.entity;
|
||||
package org.dromara.neutrinoproxy.server.dal.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
@@ -19,12 +19,13 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.dal.entity;
|
||||
package org.dromara.neutrinoproxy.server.dal.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import fun.asgc.neutrino.proxy.server.constant.OnlineStatusEnum;
|
||||
import org.dromara.neutrinoproxy.server.constant.EnableStatusEnum;
|
||||
import org.dromara.neutrinoproxy.server.constant.OnlineStatusEnum;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.Accessors;
|
||||
@@ -47,6 +48,14 @@ public class PortMappingDO {
|
||||
* licenseId
|
||||
*/
|
||||
private Integer licenseId;
|
||||
/**
|
||||
* 协议
|
||||
*/
|
||||
private String protocal;
|
||||
/**
|
||||
* 子域名
|
||||
*/
|
||||
private String subdomain;
|
||||
/**
|
||||
* 服务端端口
|
||||
*/
|
||||
@@ -66,7 +75,7 @@ public class PortMappingDO {
|
||||
private Integer isOnline;
|
||||
/**
|
||||
* 启用状态
|
||||
* {@link fun.asgc.neutrino.proxy.server.constant.EnableStatusEnum}
|
||||
* {@link EnableStatusEnum}
|
||||
*/
|
||||
private Integer enable;
|
||||
/**
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.dal.entity;
|
||||
package org.dromara.neutrinoproxy.server.dal.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.dal.entity;
|
||||
package org.dromara.neutrinoproxy.server.dal.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
@@ -10,7 +10,7 @@
|
||||
* in accordance with the terms of the contract agreement
|
||||
* you entered into with Zeyi inc.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.dal.entity;
|
||||
package org.dromara.neutrinoproxy.server.dal.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.dal.entity;
|
||||
package org.dromara.neutrinoproxy.server.dal.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
@@ -1,8 +1,8 @@
|
||||
package fun.asgc.neutrino.proxy.server.job;
|
||||
package org.dromara.neutrinoproxy.server.job;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import fun.asgc.neutrino.proxy.core.util.DateUtil;
|
||||
import fun.asgc.neutrino.proxy.server.dal.*;
|
||||
import org.dromara.neutrinoproxy.core.util.DateUtil;
|
||||
import org.dromara.neutrinoproxy.server.dal.*;
|
||||
import fun.asgc.solon.extend.job.IJobHandler;
|
||||
import fun.asgc.solon.extend.job.annotation.JobHandler;
|
||||
import lombok.Data;
|
||||
@@ -1,4 +1,4 @@
|
||||
package fun.asgc.neutrino.proxy.server.job;
|
||||
package org.dromara.neutrinoproxy.server.job;
|
||||
|
||||
import fun.asgc.solon.extend.job.IJobHandler;
|
||||
import fun.asgc.solon.extend.job.annotation.JobHandler;
|
||||
@@ -19,17 +19,17 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.job;
|
||||
package org.dromara.neutrinoproxy.server.job;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import fun.asgc.neutrino.proxy.core.util.DateUtil;
|
||||
import fun.asgc.neutrino.proxy.server.dal.FlowReportDayMapper;
|
||||
import fun.asgc.neutrino.proxy.server.dal.FlowReportHourMapper;
|
||||
import fun.asgc.neutrino.proxy.server.dal.FlowReportMinuteMapper;
|
||||
import fun.asgc.neutrino.proxy.server.dal.LicenseMapper;
|
||||
import fun.asgc.neutrino.proxy.server.dal.entity.FlowReportDayDO;
|
||||
import fun.asgc.neutrino.proxy.server.dal.entity.FlowReportHourDO;
|
||||
import fun.asgc.neutrino.proxy.server.service.FlowReportService;
|
||||
import org.dromara.neutrinoproxy.core.util.DateUtil;
|
||||
import org.dromara.neutrinoproxy.server.dal.FlowReportDayMapper;
|
||||
import org.dromara.neutrinoproxy.server.dal.FlowReportHourMapper;
|
||||
import org.dromara.neutrinoproxy.server.dal.FlowReportMinuteMapper;
|
||||
import org.dromara.neutrinoproxy.server.dal.LicenseMapper;
|
||||
import org.dromara.neutrinoproxy.server.dal.entity.FlowReportDayDO;
|
||||
import org.dromara.neutrinoproxy.server.dal.entity.FlowReportHourDO;
|
||||
import org.dromara.neutrinoproxy.server.service.FlowReportService;
|
||||
import fun.asgc.solon.extend.job.IJobHandler;
|
||||
import fun.asgc.solon.extend.job.annotation.JobHandler;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -1,13 +1,13 @@
|
||||
package fun.asgc.neutrino.proxy.server.job;
|
||||
package org.dromara.neutrinoproxy.server.job;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import fun.asgc.neutrino.proxy.core.util.DateUtil;
|
||||
import fun.asgc.neutrino.proxy.server.dal.FlowReportHourMapper;
|
||||
import fun.asgc.neutrino.proxy.server.dal.FlowReportMinuteMapper;
|
||||
import fun.asgc.neutrino.proxy.server.dal.LicenseMapper;
|
||||
import fun.asgc.neutrino.proxy.server.dal.entity.FlowReportHourDO;
|
||||
import fun.asgc.neutrino.proxy.server.dal.entity.FlowReportMinuteDO;
|
||||
import fun.asgc.neutrino.proxy.server.service.FlowReportService;
|
||||
import org.dromara.neutrinoproxy.core.util.DateUtil;
|
||||
import org.dromara.neutrinoproxy.server.dal.FlowReportHourMapper;
|
||||
import org.dromara.neutrinoproxy.server.dal.FlowReportMinuteMapper;
|
||||
import org.dromara.neutrinoproxy.server.dal.LicenseMapper;
|
||||
import org.dromara.neutrinoproxy.server.dal.entity.FlowReportHourDO;
|
||||
import org.dromara.neutrinoproxy.server.dal.entity.FlowReportMinuteDO;
|
||||
import org.dromara.neutrinoproxy.server.service.FlowReportService;
|
||||
import fun.asgc.solon.extend.job.IJobHandler;
|
||||
import fun.asgc.solon.extend.job.annotation.JobHandler;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -1,12 +1,12 @@
|
||||
package fun.asgc.neutrino.proxy.server.job;
|
||||
package org.dromara.neutrinoproxy.server.job;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import fun.asgc.neutrino.proxy.core.util.DateUtil;
|
||||
import fun.asgc.neutrino.proxy.server.dal.FlowReportMinuteMapper;
|
||||
import fun.asgc.neutrino.proxy.server.dal.LicenseMapper;
|
||||
import fun.asgc.neutrino.proxy.server.dal.entity.FlowReportMinuteDO;
|
||||
import fun.asgc.neutrino.proxy.server.dal.entity.LicenseDO;
|
||||
import fun.asgc.neutrino.proxy.server.service.FlowReportService;
|
||||
import org.dromara.neutrinoproxy.core.util.DateUtil;
|
||||
import org.dromara.neutrinoproxy.server.dal.FlowReportMinuteMapper;
|
||||
import org.dromara.neutrinoproxy.server.dal.LicenseMapper;
|
||||
import org.dromara.neutrinoproxy.server.dal.entity.FlowReportMinuteDO;
|
||||
import org.dromara.neutrinoproxy.server.dal.entity.LicenseDO;
|
||||
import org.dromara.neutrinoproxy.server.service.FlowReportService;
|
||||
import fun.asgc.solon.extend.job.IJobHandler;
|
||||
import fun.asgc.solon.extend.job.annotation.JobHandler;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -1,11 +1,11 @@
|
||||
package fun.asgc.neutrino.proxy.server.job;
|
||||
package org.dromara.neutrinoproxy.server.job;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import fun.asgc.neutrino.proxy.core.util.DateUtil;
|
||||
import fun.asgc.neutrino.proxy.server.dal.*;
|
||||
import fun.asgc.neutrino.proxy.server.dal.entity.FlowReportDayDO;
|
||||
import fun.asgc.neutrino.proxy.server.dal.entity.FlowReportMonthDO;
|
||||
import fun.asgc.neutrino.proxy.server.service.FlowReportService;
|
||||
import org.dromara.neutrinoproxy.core.util.DateUtil;
|
||||
import org.dromara.neutrinoproxy.server.dal.*;
|
||||
import org.dromara.neutrinoproxy.server.dal.entity.FlowReportDayDO;
|
||||
import org.dromara.neutrinoproxy.server.dal.entity.FlowReportMonthDO;
|
||||
import org.dromara.neutrinoproxy.server.service.FlowReportService;
|
||||
import fun.asgc.solon.extend.job.IJobHandler;
|
||||
import fun.asgc.solon.extend.job.annotation.JobHandler;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -20,9 +20,9 @@
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package fun.asgc.neutrino.proxy.server.proxy.core;
|
||||
package org.dromara.neutrinoproxy.server.proxy.core;
|
||||
|
||||
import fun.asgc.neutrino.proxy.server.proxy.domain.MetricsCollector;
|
||||
import org.dromara.neutrinoproxy.server.proxy.domain.MetricsCollector;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.channel.ChannelDuplexHandler;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
@@ -0,0 +1,192 @@
|
||||
package org.dromara.neutrinoproxy.server.proxy.core;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import io.netty.bootstrap.ServerBootstrap;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.channel.*;
|
||||
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 org.apache.commons.lang3.StringUtils;
|
||||
import org.dromara.neutrinoproxy.core.Constants;
|
||||
import org.dromara.neutrinoproxy.core.ProxyMessage;
|
||||
import org.dromara.neutrinoproxy.server.base.proxy.ProxyConfig;
|
||||
import org.dromara.neutrinoproxy.server.proxy.domain.ProxyAttachment;
|
||||
import org.dromara.neutrinoproxy.server.proxy.domain.VisitorChannelAttachInfo;
|
||||
import org.dromara.neutrinoproxy.server.service.FlowReportService;
|
||||
import org.dromara.neutrinoproxy.server.util.ProxyUtil;
|
||||
import org.noear.solon.Solon;
|
||||
import org.noear.solon.annotation.Component;
|
||||
import org.noear.solon.annotation.Inject;
|
||||
import org.noear.solon.core.event.AppLoadEndEvent;
|
||||
import org.noear.solon.core.event.EventListener;
|
||||
|
||||
import java.net.InetSocketAddress;
|
||||
|
||||
/**
|
||||
* @author: aoshiguchen
|
||||
* @date: 2023/4/2
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class HttpProxy implements EventListener<AppLoadEndEvent> {
|
||||
@Inject("serverBossGroup")
|
||||
private NioEventLoopGroup serverBossGroup;
|
||||
@Inject("serverWorkerGroup")
|
||||
private NioEventLoopGroup serverWorkerGroup;
|
||||
@Inject
|
||||
private ProxyConfig proxyConfig;
|
||||
@Override
|
||||
public void onEvent(AppLoadEndEvent appLoadEndEvent) throws Throwable {
|
||||
if (StrUtil.isBlank(proxyConfig.getServer().getDomainName())) {
|
||||
log.info("no config domain name,nonsupport http proxy.");
|
||||
return;
|
||||
}
|
||||
this.start();
|
||||
}
|
||||
|
||||
private void start() {
|
||||
try {
|
||||
ServerBootstrap bootstrap = new ServerBootstrap();
|
||||
bootstrap.group(serverBossGroup, serverWorkerGroup)
|
||||
.channel(NioServerSocketChannel.class).childHandler(new ChannelInitializer<SocketChannel>() {
|
||||
@Override
|
||||
public void initChannel(SocketChannel ch) throws Exception {
|
||||
ch.pipeline().addFirst(new BytesMetricsHandler());
|
||||
ch.pipeline().addLast(new VisitorChannelHandler());
|
||||
}
|
||||
});
|
||||
bootstrap.bind("0.0.0.0", 80).sync();
|
||||
log.info("Http代理服务启动成功!");
|
||||
} catch (Exception e) {
|
||||
log.error("http proxy start err!", e);
|
||||
}
|
||||
}
|
||||
|
||||
private class VisitorChannelHandler extends SimpleChannelInboundHandler<ByteBuf> {
|
||||
|
||||
@Override
|
||||
protected void channelRead0(ChannelHandlerContext ctx, ByteBuf byteBuf) throws Exception {
|
||||
if (StrUtil.isBlank(proxyConfig.getServer().getDomainName())) {
|
||||
ctx.channel().close();
|
||||
return;
|
||||
}
|
||||
String host = getHost(byteBuf);
|
||||
if (StringUtils.isBlank(host)) {
|
||||
ctx.channel().close();
|
||||
return;
|
||||
}
|
||||
log.debug("HttpProxy host: {}", host);
|
||||
if (!host.endsWith(proxyConfig.getServer().getDomainName())) {
|
||||
ctx.channel().close();
|
||||
return;
|
||||
}
|
||||
int index = host.lastIndexOf("." + proxyConfig.getServer().getDomainName());
|
||||
String subdomain = host.substring(0, index);
|
||||
|
||||
// 根据域名拿到绑定的映射对应的cmdChannel
|
||||
Integer serverPort = ProxyUtil.getServerPortBySubdomain(subdomain);
|
||||
if (null == serverPort) {
|
||||
ctx.channel().close();
|
||||
return;
|
||||
}
|
||||
Channel cmdChannel = ProxyUtil.getCmdChannelByServerPort(serverPort);
|
||||
if (null == cmdChannel) {
|
||||
ctx.channel().close();
|
||||
return;
|
||||
}
|
||||
String lanInfo = ProxyUtil.getClientLanInfoByServerPort(serverPort);
|
||||
if (StringUtils.isBlank(lanInfo)) {
|
||||
ctx.channel().close();
|
||||
return;
|
||||
}
|
||||
|
||||
String visitorId = ProxyUtil.newVisitorId();
|
||||
Channel visitorChannel = ctx.channel();
|
||||
|
||||
byte[] bytes = new byte[byteBuf.readableBytes()];
|
||||
byteBuf.readBytes(bytes);
|
||||
ProxyAttachment proxyAttachment = new ProxyAttachment(ctx.channel(), bytes, (channel, buf) -> {
|
||||
Channel proxyChannel = channel.attr(Constants.NEXT_CHANNEL).get();
|
||||
if (null == proxyChannel) {
|
||||
// 该端口还没有代理客户端
|
||||
ctx.channel().close();
|
||||
return;
|
||||
}
|
||||
proxyChannel.writeAndFlush(ProxyMessage.buildTransferMessage(visitorId, bytes));
|
||||
|
||||
// 增加流量计数
|
||||
VisitorChannelAttachInfo visitorChannelAttachInfo = ProxyUtil.getAttachInfo(visitorChannel);
|
||||
Solon.context().getBean(FlowReportService.class).addWriteByte(visitorChannelAttachInfo.getLicenseId(), bytes.length);
|
||||
});
|
||||
|
||||
ProxyUtil.addVisitorChannelToCmdChannel(cmdChannel, visitorId, visitorChannel, serverPort);
|
||||
ProxyUtil.addProxyConnectAttachment(visitorId, proxyAttachment);
|
||||
cmdChannel.writeAndFlush(ProxyMessage.buildConnectMessage(visitorId).setData(lanInfo.getBytes()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
|
||||
|
||||
// 通知代理客户端
|
||||
Channel visitorChannel = ctx.channel();
|
||||
InetSocketAddress sa = (InetSocketAddress) visitorChannel.localAddress();
|
||||
Channel cmdChannel = ProxyUtil.getCmdChannelByServerPort(sa.getPort());
|
||||
|
||||
if (cmdChannel == null) {
|
||||
// 该端口还没有代理客户端
|
||||
ctx.channel().close();
|
||||
} else {
|
||||
|
||||
// 用户连接断开,从控制连接中移除
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
||||
super.channelInactive(ctx);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
|
||||
// 当出现异常就关闭连接
|
||||
ctx.close();
|
||||
}
|
||||
|
||||
private String getHost(ByteBuf byteBuf) {
|
||||
byte[] buf = new byte[byteBuf.readableBytes()];
|
||||
byteBuf.readBytes(buf);
|
||||
byteBuf.resetReaderIndex();
|
||||
String req = new String(buf);
|
||||
String[] lines = req.split("\r\n");
|
||||
String firstLine = lines[0];
|
||||
if (!(firstLine.endsWith("HTTP/1.1") || firstLine.endsWith("HTTP/1.0"))) {
|
||||
return null;
|
||||
}
|
||||
for (int i = 1; i < lines.length; i++) {
|
||||
String line = lines[i];
|
||||
if (!line.startsWith("Host: ")) {
|
||||
continue;
|
||||
}
|
||||
// 域名
|
||||
String domain = line.substring(6);
|
||||
return domain;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
package fun.asgc.neutrino.proxy.server.proxy.core;
|
||||
package org.dromara.neutrinoproxy.server.proxy.core;
|
||||
|
||||
import fun.asgc.neutrino.proxy.core.ProxyMessageDecoder;
|
||||
import fun.asgc.neutrino.proxy.core.ProxyMessageEncoder;
|
||||
import fun.asgc.neutrino.proxy.core.util.FileUtil;
|
||||
import fun.asgc.neutrino.proxy.server.base.proxy.ProxyConfig;
|
||||
import org.dromara.neutrinoproxy.core.ProxyMessageDecoder;
|
||||
import org.dromara.neutrinoproxy.core.ProxyMessageEncoder;
|
||||
import org.dromara.neutrinoproxy.core.util.FileUtil;
|
||||
import org.dromara.neutrinoproxy.server.base.proxy.ProxyConfig;
|
||||
import io.netty.bootstrap.ServerBootstrap;
|
||||
import io.netty.channel.ChannelHandler;
|
||||
import io.netty.channel.ChannelInitializer;
|
||||
@@ -20,18 +20,18 @@
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package fun.asgc.neutrino.proxy.server.proxy.core;
|
||||
package org.dromara.neutrinoproxy.server.proxy.core;
|
||||
|
||||
import fun.asgc.neutrino.proxy.core.Constants;
|
||||
import fun.asgc.neutrino.proxy.core.ProxyMessage;
|
||||
import fun.asgc.neutrino.proxy.core.dispatcher.Dispatcher;
|
||||
import fun.asgc.neutrino.proxy.server.constant.ClientConnectTypeEnum;
|
||||
import fun.asgc.neutrino.proxy.server.constant.SuccessCodeEnum;
|
||||
import fun.asgc.neutrino.proxy.server.dal.entity.ClientConnectRecordDO;
|
||||
import fun.asgc.neutrino.proxy.server.proxy.domain.CmdChannelAttachInfo;
|
||||
import fun.asgc.neutrino.proxy.server.service.ClientConnectRecordService;
|
||||
import fun.asgc.neutrino.proxy.server.service.ProxyMutualService;
|
||||
import fun.asgc.neutrino.proxy.server.util.ProxyUtil;
|
||||
import org.dromara.neutrinoproxy.core.Constants;
|
||||
import org.dromara.neutrinoproxy.core.ProxyMessage;
|
||||
import org.dromara.neutrinoproxy.core.dispatcher.Dispatcher;
|
||||
import org.dromara.neutrinoproxy.server.constant.ClientConnectTypeEnum;
|
||||
import org.dromara.neutrinoproxy.server.constant.SuccessCodeEnum;
|
||||
import org.dromara.neutrinoproxy.server.dal.entity.ClientConnectRecordDO;
|
||||
import org.dromara.neutrinoproxy.server.proxy.domain.CmdChannelAttachInfo;
|
||||
import org.dromara.neutrinoproxy.server.service.ClientConnectRecordService;
|
||||
import org.dromara.neutrinoproxy.server.service.ProxyMutualService;
|
||||
import org.dromara.neutrinoproxy.server.util.ProxyUtil;
|
||||
import io.netty.buffer.Unpooled;
|
||||
import io.netty.channel.*;
|
||||
import io.netty.handler.timeout.IdleStateEvent;
|
||||
@@ -1,11 +1,13 @@
|
||||
package fun.asgc.neutrino.proxy.server.proxy.core;
|
||||
package org.dromara.neutrinoproxy.server.proxy.core;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import fun.asgc.neutrino.proxy.core.Constants;
|
||||
import fun.asgc.neutrino.proxy.core.ProxyMessage;
|
||||
import fun.asgc.neutrino.proxy.server.proxy.domain.VisitorChannelAttachInfo;
|
||||
import fun.asgc.neutrino.proxy.server.service.FlowReportService;
|
||||
import fun.asgc.neutrino.proxy.server.util.ProxyUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.neutrinoproxy.core.Constants;
|
||||
import org.dromara.neutrinoproxy.core.ProxyMessage;
|
||||
import org.dromara.neutrinoproxy.server.proxy.domain.ProxyAttachment;
|
||||
import org.dromara.neutrinoproxy.server.proxy.domain.VisitorChannelAttachInfo;
|
||||
import org.dromara.neutrinoproxy.server.service.FlowReportService;
|
||||
import org.dromara.neutrinoproxy.server.util.ProxyUtil;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.channel.Channel;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
@@ -14,44 +16,42 @@ import io.netty.channel.SimpleChannelInboundHandler;
|
||||
import org.noear.solon.Solon;
|
||||
|
||||
import java.net.InetSocketAddress;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author: aoshiguchen
|
||||
* @date: 2022/6/16
|
||||
*/
|
||||
@Slf4j
|
||||
public class VisitorChannelHandler extends SimpleChannelInboundHandler<ByteBuf> {
|
||||
|
||||
private static AtomicLong visitorIdProducer = new AtomicLong(0);
|
||||
|
||||
@Override
|
||||
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
|
||||
|
||||
// 当出现异常就关闭连接
|
||||
ctx.close();
|
||||
log.error("VisitorChannel error", cause);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void channelRead0(ChannelHandlerContext ctx, ByteBuf buf) throws Exception {
|
||||
|
||||
// 通知代理客户端
|
||||
Channel visitorChannel = ctx.channel();
|
||||
Channel proxyChannel = visitorChannel.attr(Constants.NEXT_CHANNEL).get();
|
||||
if (proxyChannel == null) {
|
||||
|
||||
if (null == proxyChannel) {
|
||||
// 该端口还没有代理客户端
|
||||
ctx.channel().close();
|
||||
} else {
|
||||
byte[] bytes = new byte[buf.readableBytes()];
|
||||
buf.readBytes(bytes);
|
||||
String visitorId = ProxyUtil.getVisitorIdByChannel(visitorChannel);
|
||||
proxyChannel.writeAndFlush(ProxyMessage.buildTransferMessage(visitorId, bytes));
|
||||
|
||||
// 增加流量计数
|
||||
VisitorChannelAttachInfo visitorChannelAttachInfo = ProxyUtil.getAttachInfo(visitorChannel);
|
||||
Solon.context().getBean(FlowReportService.class).addWriteByte(visitorChannelAttachInfo.getLicenseId(), bytes.length);
|
||||
return;
|
||||
}
|
||||
// 转发代理数据
|
||||
byte[] bytes = new byte[buf.readableBytes()];
|
||||
buf.readBytes(bytes);
|
||||
String visitorId = ProxyUtil.getVisitorIdByChannel(visitorChannel);
|
||||
proxyChannel.writeAndFlush(ProxyMessage.buildTransferMessage(visitorId, bytes));
|
||||
|
||||
// 增加流量计数
|
||||
VisitorChannelAttachInfo visitorChannelAttachInfo = ProxyUtil.getAttachInfo(visitorChannel);
|
||||
Solon.context().getBean(FlowReportService.class).addWriteByte(visitorChannelAttachInfo.getLicenseId(), bytes.length);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -60,23 +60,26 @@ public class VisitorChannelHandler extends SimpleChannelInboundHandler<ByteBuf>
|
||||
InetSocketAddress sa = (InetSocketAddress) visitorChannel.localAddress();
|
||||
Channel cmdChannel = ProxyUtil.getCmdChannelByServerPort(sa.getPort());
|
||||
|
||||
if (cmdChannel == null) {
|
||||
if (null == cmdChannel) {
|
||||
// 该端口还没有代理客户端
|
||||
ctx.channel().close();
|
||||
} else {
|
||||
String visitorId = newVisitorId();
|
||||
String lanInfo = ProxyUtil.getClientLanInfoByServerPort(sa.getPort());
|
||||
if (StrUtil.isEmpty(lanInfo)) {
|
||||
ctx.channel().close();
|
||||
} else {
|
||||
// 用户连接到代理服务器时,设置用户连接不可读,等待代理后端服务器连接成功后再改变为可读状态
|
||||
visitorChannel.config().setOption(ChannelOption.AUTO_READ, false);
|
||||
|
||||
ProxyUtil.addVisitorChannelToCmdChannel(cmdChannel, visitorId, visitorChannel, sa.getPort());
|
||||
cmdChannel.writeAndFlush(ProxyMessage.buildConnectMessage(visitorId).setData(lanInfo.getBytes()));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// 根据代理服务端端口,获取被代理客户端局域网连接信息
|
||||
String lanInfo = ProxyUtil.getClientLanInfoByServerPort(sa.getPort());
|
||||
if (StrUtil.isEmpty(lanInfo)) {
|
||||
ctx.channel().close();
|
||||
return;
|
||||
}
|
||||
|
||||
// 用户连接到代理服务器时,设置用户连接不可读,等待代理后端服务器连接成功后再改变为可读状态
|
||||
visitorChannel.config().setOption(ChannelOption.AUTO_READ, false);
|
||||
|
||||
String visitorId = ProxyUtil.newVisitorId();
|
||||
ProxyUtil.addVisitorChannelToCmdChannel(cmdChannel, visitorId, visitorChannel, sa.getPort());
|
||||
cmdChannel.writeAndFlush(ProxyMessage.buildConnectMessage(visitorId).setData(lanInfo.getBytes()));
|
||||
|
||||
super.channelActive(ctx);
|
||||
}
|
||||
|
||||
@@ -84,8 +87,8 @@ public class VisitorChannelHandler extends SimpleChannelInboundHandler<ByteBuf>
|
||||
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
|
||||
|
||||
// 通知代理客户端
|
||||
Channel userChannel = ctx.channel();
|
||||
InetSocketAddress sa = (InetSocketAddress) userChannel.localAddress();
|
||||
Channel visitorChannel = ctx.channel();
|
||||
InetSocketAddress sa = (InetSocketAddress) visitorChannel.localAddress();
|
||||
Channel cmdChannel = ProxyUtil.getCmdChannelByServerPort(sa.getPort());
|
||||
|
||||
if (cmdChannel == null) {
|
||||
@@ -95,10 +98,13 @@ public class VisitorChannelHandler extends SimpleChannelInboundHandler<ByteBuf>
|
||||
} else {
|
||||
|
||||
// 用户连接断开,从控制连接中移除
|
||||
String userId = ProxyUtil.getVisitorIdByChannel(userChannel);
|
||||
ProxyUtil.removeVisitorChannelFromCmdChannel(cmdChannel, userId);
|
||||
String visitorId = ProxyUtil.getVisitorIdByChannel(visitorChannel);
|
||||
ProxyUtil.removeVisitorChannelFromCmdChannel(cmdChannel, visitorId);
|
||||
|
||||
Channel proxyChannel = userChannel.attr(Constants.NEXT_CHANNEL).get();
|
||||
// 删除代理附加对象
|
||||
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();
|
||||
@@ -106,7 +112,7 @@ public class VisitorChannelHandler extends SimpleChannelInboundHandler<ByteBuf>
|
||||
|
||||
proxyChannel.config().setOption(ChannelOption.AUTO_READ, true);
|
||||
// 通知客户端,用户连接已经断开
|
||||
proxyChannel.writeAndFlush(ProxyMessage.buildDisconnectMessage(userId));
|
||||
proxyChannel.writeAndFlush(ProxyMessage.buildDisconnectMessage(visitorId));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,12 +140,4 @@ public class VisitorChannelHandler extends SimpleChannelInboundHandler<ByteBuf>
|
||||
super.channelWritabilityChanged(ctx);
|
||||
}
|
||||
|
||||
/**
|
||||
* 为访问者连接产生ID
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private static String newVisitorId() {
|
||||
return String.valueOf(visitorIdProducer.incrementAndGet());
|
||||
}
|
||||
}
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.proxy.domain;
|
||||
package org.dromara.neutrinoproxy.server.proxy.domain;
|
||||
|
||||
import io.netty.channel.Channel;
|
||||
import lombok.Data;
|
||||
@@ -0,0 +1,22 @@
|
||||
package org.dromara.neutrinoproxy.server.proxy.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author: aoshiguchen
|
||||
* @date: 2022/6/16
|
||||
*/
|
||||
@Data
|
||||
public class Metrics implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
private int port;
|
||||
private long readBytes;
|
||||
private long wroteBytes;
|
||||
private long readMsgs;
|
||||
private long wroteMsgs;
|
||||
private int channels;
|
||||
private long timestamp;
|
||||
}
|
||||
@@ -20,7 +20,7 @@
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package fun.asgc.neutrino.proxy.server.proxy.domain;
|
||||
package org.dromara.neutrinoproxy.server.proxy.domain;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
@@ -0,0 +1,29 @@
|
||||
package org.dromara.neutrinoproxy.server.proxy.domain;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.channel.Channel;
|
||||
|
||||
import java.util.function.BiConsumer;
|
||||
|
||||
/**
|
||||
* 代理连接附件
|
||||
* @author: aoshiguchen
|
||||
* @date: 2023/4/2
|
||||
*/
|
||||
public class ProxyAttachment {
|
||||
private Channel channel;
|
||||
private byte[] bytes;
|
||||
private BiConsumer<Channel, byte[]> executor;
|
||||
|
||||
public ProxyAttachment(Channel channel, byte[] bytes, BiConsumer<Channel, byte[]> executor) {
|
||||
this.channel = channel;
|
||||
this.bytes = bytes;
|
||||
this.executor = executor;
|
||||
}
|
||||
|
||||
public void execute() {
|
||||
if (null != executor) {
|
||||
this.executor.accept(channel, bytes);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package fun.asgc.neutrino.proxy.server.proxy.domain;
|
||||
package org.dromara.neutrinoproxy.server.proxy.domain;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import fun.asgc.neutrino.proxy.server.dal.entity.PortMappingDO;
|
||||
import org.dromara.neutrinoproxy.server.dal.entity.PortMappingDO;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.proxy.domain;
|
||||
package org.dromara.neutrinoproxy.server.proxy.domain;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
@@ -20,22 +20,23 @@
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package fun.asgc.neutrino.proxy.server.proxy.handler;
|
||||
package org.dromara.neutrinoproxy.server.proxy.handler;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import fun.asgc.neutrino.proxy.core.*;
|
||||
import fun.asgc.neutrino.proxy.core.dispatcher.Match;
|
||||
import fun.asgc.neutrino.proxy.server.base.proxy.ProxyConfig;
|
||||
import fun.asgc.neutrino.proxy.server.constant.ClientConnectTypeEnum;
|
||||
import fun.asgc.neutrino.proxy.server.constant.EnableStatusEnum;
|
||||
import fun.asgc.neutrino.proxy.server.constant.OnlineStatusEnum;
|
||||
import fun.asgc.neutrino.proxy.server.constant.SuccessCodeEnum;
|
||||
import fun.asgc.neutrino.proxy.server.dal.LicenseMapper;
|
||||
import fun.asgc.neutrino.proxy.server.dal.entity.ClientConnectRecordDO;
|
||||
import fun.asgc.neutrino.proxy.server.dal.entity.LicenseDO;
|
||||
import fun.asgc.neutrino.proxy.server.dal.entity.UserDO;
|
||||
import fun.asgc.neutrino.proxy.server.service.*;
|
||||
import fun.asgc.neutrino.proxy.server.util.ProxyUtil;
|
||||
import org.dromara.neutrinoproxy.core.*;
|
||||
import org.dromara.neutrinoproxy.core.*;
|
||||
import org.dromara.neutrinoproxy.core.dispatcher.Match;
|
||||
import org.dromara.neutrinoproxy.server.base.proxy.ProxyConfig;
|
||||
import org.dromara.neutrinoproxy.server.constant.ClientConnectTypeEnum;
|
||||
import org.dromara.neutrinoproxy.server.constant.EnableStatusEnum;
|
||||
import org.dromara.neutrinoproxy.server.constant.OnlineStatusEnum;
|
||||
import org.dromara.neutrinoproxy.server.constant.SuccessCodeEnum;
|
||||
import org.dromara.neutrinoproxy.server.dal.LicenseMapper;
|
||||
import org.dromara.neutrinoproxy.server.dal.entity.ClientConnectRecordDO;
|
||||
import org.dromara.neutrinoproxy.server.dal.entity.LicenseDO;
|
||||
import org.dromara.neutrinoproxy.server.dal.entity.UserDO;
|
||||
import org.dromara.neutrinoproxy.server.service.*;
|
||||
import org.dromara.neutrinoproxy.server.util.ProxyUtil;
|
||||
import io.netty.channel.Channel;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -1,14 +1,16 @@
|
||||
package fun.asgc.neutrino.proxy.server.proxy.handler;
|
||||
package org.dromara.neutrinoproxy.server.proxy.handler;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import fun.asgc.neutrino.proxy.core.*;
|
||||
import fun.asgc.neutrino.proxy.core.dispatcher.Match;
|
||||
import fun.asgc.neutrino.proxy.server.constant.EnableStatusEnum;
|
||||
import fun.asgc.neutrino.proxy.server.dal.entity.LicenseDO;
|
||||
import fun.asgc.neutrino.proxy.server.dal.entity.UserDO;
|
||||
import fun.asgc.neutrino.proxy.server.service.LicenseService;
|
||||
import fun.asgc.neutrino.proxy.server.service.UserService;
|
||||
import fun.asgc.neutrino.proxy.server.util.ProxyUtil;
|
||||
import org.dromara.neutrinoproxy.core.*;
|
||||
import org.dromara.neutrinoproxy.core.*;
|
||||
import org.dromara.neutrinoproxy.core.dispatcher.Match;
|
||||
import org.dromara.neutrinoproxy.server.constant.EnableStatusEnum;
|
||||
import org.dromara.neutrinoproxy.server.dal.entity.LicenseDO;
|
||||
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.UserService;
|
||||
import org.dromara.neutrinoproxy.server.util.ProxyUtil;
|
||||
import io.netty.channel.Channel;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.channel.ChannelOption;
|
||||
@@ -73,13 +75,20 @@ public class ProxyMessageConnectHandler implements ProxyMessageHandler {
|
||||
}
|
||||
|
||||
Channel visitorChannel = ProxyUtil.getVisitorChannel(cmdChannel, visitorId);
|
||||
if (visitorChannel != null) {
|
||||
ctx.channel().attr(Constants.VISITOR_ID).set(visitorId);
|
||||
ctx.channel().attr(Constants.LICENSE_ID).set(licenseDO.getId());
|
||||
ctx.channel().attr(Constants.NEXT_CHANNEL).set(visitorChannel);
|
||||
visitorChannel.attr(Constants.NEXT_CHANNEL).set(ctx.channel());
|
||||
// 代理客户端与后端服务器连接成功,修改用户连接为可读状态
|
||||
visitorChannel.config().setOption(ChannelOption.AUTO_READ, true);
|
||||
if (null == visitorChannel) {
|
||||
return;
|
||||
}
|
||||
ctx.channel().attr(Constants.VISITOR_ID).set(visitorId);
|
||||
ctx.channel().attr(Constants.LICENSE_ID).set(licenseDO.getId());
|
||||
ctx.channel().attr(Constants.NEXT_CHANNEL).set(visitorChannel);
|
||||
visitorChannel.attr(Constants.NEXT_CHANNEL).set(ctx.channel());
|
||||
// 代理客户端与后端服务器连接成功,修改用户连接为可读状态
|
||||
visitorChannel.config().setOption(ChannelOption.AUTO_READ, true);
|
||||
|
||||
// 获取代理附加对象
|
||||
ProxyAttachment proxyAttachment = ProxyUtil.getProxyConnectAttachment(visitorId);
|
||||
if (null != proxyAttachment) {
|
||||
proxyAttachment.execute();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package fun.asgc.neutrino.proxy.server.proxy.handler;
|
||||
package org.dromara.neutrinoproxy.server.proxy.handler;
|
||||
|
||||
import fun.asgc.neutrino.proxy.core.Constants;
|
||||
import fun.asgc.neutrino.proxy.core.ProxyDataTypeEnum;
|
||||
import fun.asgc.neutrino.proxy.core.ProxyMessage;
|
||||
import fun.asgc.neutrino.proxy.core.ProxyMessageHandler;
|
||||
import fun.asgc.neutrino.proxy.core.dispatcher.Match;
|
||||
import fun.asgc.neutrino.proxy.server.util.ProxyUtil;
|
||||
import org.dromara.neutrinoproxy.core.Constants;
|
||||
import org.dromara.neutrinoproxy.core.ProxyDataTypeEnum;
|
||||
import org.dromara.neutrinoproxy.core.ProxyMessage;
|
||||
import org.dromara.neutrinoproxy.core.ProxyMessageHandler;
|
||||
import org.dromara.neutrinoproxy.core.dispatcher.Match;
|
||||
import org.dromara.neutrinoproxy.server.util.ProxyUtil;
|
||||
import io.netty.buffer.Unpooled;
|
||||
import io.netty.channel.Channel;
|
||||
import io.netty.channel.ChannelFutureListener;
|
||||
@@ -1,10 +1,10 @@
|
||||
package fun.asgc.neutrino.proxy.server.proxy.handler;
|
||||
package org.dromara.neutrinoproxy.server.proxy.handler;
|
||||
|
||||
import fun.asgc.neutrino.proxy.core.Constants;
|
||||
import fun.asgc.neutrino.proxy.core.ProxyDataTypeEnum;
|
||||
import fun.asgc.neutrino.proxy.core.ProxyMessage;
|
||||
import fun.asgc.neutrino.proxy.core.ProxyMessageHandler;
|
||||
import fun.asgc.neutrino.proxy.core.dispatcher.Match;
|
||||
import org.dromara.neutrinoproxy.core.Constants;
|
||||
import org.dromara.neutrinoproxy.core.ProxyDataTypeEnum;
|
||||
import org.dromara.neutrinoproxy.core.ProxyMessage;
|
||||
import org.dromara.neutrinoproxy.core.ProxyMessageHandler;
|
||||
import org.dromara.neutrinoproxy.core.dispatcher.Match;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import org.noear.solon.annotation.Component;
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package fun.asgc.neutrino.proxy.server.proxy.handler;
|
||||
package org.dromara.neutrinoproxy.server.proxy.handler;
|
||||
|
||||
import fun.asgc.neutrino.proxy.core.Constants;
|
||||
import fun.asgc.neutrino.proxy.core.ProxyDataTypeEnum;
|
||||
import fun.asgc.neutrino.proxy.core.ProxyMessage;
|
||||
import fun.asgc.neutrino.proxy.core.ProxyMessageHandler;
|
||||
import fun.asgc.neutrino.proxy.core.dispatcher.Match;
|
||||
import fun.asgc.neutrino.proxy.server.proxy.domain.VisitorChannelAttachInfo;
|
||||
import fun.asgc.neutrino.proxy.server.service.FlowReportService;
|
||||
import fun.asgc.neutrino.proxy.server.util.ProxyUtil;
|
||||
import org.dromara.neutrinoproxy.core.Constants;
|
||||
import org.dromara.neutrinoproxy.core.ProxyDataTypeEnum;
|
||||
import org.dromara.neutrinoproxy.core.ProxyMessage;
|
||||
import org.dromara.neutrinoproxy.core.ProxyMessageHandler;
|
||||
import org.dromara.neutrinoproxy.core.dispatcher.Match;
|
||||
import org.dromara.neutrinoproxy.server.proxy.domain.VisitorChannelAttachInfo;
|
||||
import org.dromara.neutrinoproxy.server.service.FlowReportService;
|
||||
import org.dromara.neutrinoproxy.server.util.ProxyUtil;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.channel.Channel;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
@@ -1,21 +1,21 @@
|
||||
package fun.asgc.neutrino.proxy.server.service;
|
||||
package org.dromara.neutrinoproxy.server.service;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import fun.asgc.neutrino.proxy.server.base.page.PageInfo;
|
||||
import fun.asgc.neutrino.proxy.server.base.page.PageQuery;
|
||||
import fun.asgc.neutrino.proxy.server.base.rest.SystemContextHolder;
|
||||
import fun.asgc.neutrino.proxy.server.controller.req.log.ClientConnectRecordListReq;
|
||||
import fun.asgc.neutrino.proxy.server.controller.res.log.ClientConnectRecordListRes;
|
||||
import fun.asgc.neutrino.proxy.server.dal.ClientConnectRecordMapper;
|
||||
import fun.asgc.neutrino.proxy.server.dal.LicenseMapper;
|
||||
import fun.asgc.neutrino.proxy.server.dal.UserMapper;
|
||||
import fun.asgc.neutrino.proxy.server.dal.entity.ClientConnectRecordDO;
|
||||
import fun.asgc.neutrino.proxy.server.dal.entity.LicenseDO;
|
||||
import fun.asgc.neutrino.proxy.server.dal.entity.UserDO;
|
||||
import org.dromara.neutrinoproxy.server.base.page.PageInfo;
|
||||
import org.dromara.neutrinoproxy.server.base.page.PageQuery;
|
||||
import org.dromara.neutrinoproxy.server.base.rest.SystemContextHolder;
|
||||
import org.dromara.neutrinoproxy.server.controller.req.log.ClientConnectRecordListReq;
|
||||
import org.dromara.neutrinoproxy.server.controller.res.log.ClientConnectRecordListRes;
|
||||
import org.dromara.neutrinoproxy.server.dal.ClientConnectRecordMapper;
|
||||
import org.dromara.neutrinoproxy.server.dal.LicenseMapper;
|
||||
import org.dromara.neutrinoproxy.server.dal.UserMapper;
|
||||
import org.dromara.neutrinoproxy.server.dal.entity.ClientConnectRecordDO;
|
||||
import org.dromara.neutrinoproxy.server.dal.entity.LicenseDO;
|
||||
import org.dromara.neutrinoproxy.server.dal.entity.UserDO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import ma.glasnost.orika.MapperFacade;
|
||||
import org.apache.ibatis.solon.annotation.Db;
|
||||
@@ -19,9 +19,9 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.service;
|
||||
package org.dromara.neutrinoproxy.server.service;
|
||||
|
||||
import fun.asgc.neutrino.proxy.core.util.LockUtil;
|
||||
import org.dromara.neutrinoproxy.core.util.LockUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.noear.solon.annotation.Component;
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
package fun.asgc.neutrino.proxy.server.service;
|
||||
package org.dromara.neutrinoproxy.server.service;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.google.common.collect.Lists;
|
||||
import fun.asgc.neutrino.proxy.server.base.page.PageInfo;
|
||||
import fun.asgc.neutrino.proxy.server.base.page.PageQuery;
|
||||
import fun.asgc.neutrino.proxy.server.constant.EnableStatusEnum;
|
||||
import fun.asgc.neutrino.proxy.server.constant.ExceptionConstant;
|
||||
import fun.asgc.neutrino.proxy.server.controller.req.system.JobInfoExecuteReq;
|
||||
import fun.asgc.neutrino.proxy.server.controller.req.system.JobInfoListReq;
|
||||
import fun.asgc.neutrino.proxy.server.controller.req.system.JobInfoUpdateEnableStatusReq;
|
||||
import fun.asgc.neutrino.proxy.server.controller.req.system.JobInfoUpdateReq;
|
||||
import fun.asgc.neutrino.proxy.server.controller.res.system.JobInfoExecuteRes;
|
||||
import fun.asgc.neutrino.proxy.server.controller.res.system.JobInfoListRes;
|
||||
import fun.asgc.neutrino.proxy.server.controller.res.system.JobInfoUpdateEnableStatusRes;
|
||||
import fun.asgc.neutrino.proxy.server.controller.res.system.JobInfoUpdateRes;
|
||||
import fun.asgc.neutrino.proxy.server.dal.JobInfoMapper;
|
||||
import fun.asgc.neutrino.proxy.server.dal.entity.JobInfoDO;
|
||||
import fun.asgc.neutrino.proxy.server.util.ParamCheckUtil;
|
||||
import org.dromara.neutrinoproxy.server.base.page.PageInfo;
|
||||
import org.dromara.neutrinoproxy.server.base.page.PageQuery;
|
||||
import org.dromara.neutrinoproxy.server.constant.EnableStatusEnum;
|
||||
import org.dromara.neutrinoproxy.server.constant.ExceptionConstant;
|
||||
import org.dromara.neutrinoproxy.server.controller.req.system.JobInfoExecuteReq;
|
||||
import org.dromara.neutrinoproxy.server.controller.req.system.JobInfoListReq;
|
||||
import org.dromara.neutrinoproxy.server.controller.req.system.JobInfoUpdateEnableStatusReq;
|
||||
import org.dromara.neutrinoproxy.server.controller.req.system.JobInfoUpdateReq;
|
||||
import org.dromara.neutrinoproxy.server.controller.res.system.JobInfoExecuteRes;
|
||||
import org.dromara.neutrinoproxy.server.controller.res.system.JobInfoListRes;
|
||||
import org.dromara.neutrinoproxy.server.controller.res.system.JobInfoUpdateEnableStatusRes;
|
||||
import org.dromara.neutrinoproxy.server.controller.res.system.JobInfoUpdateRes;
|
||||
import org.dromara.neutrinoproxy.server.dal.JobInfoMapper;
|
||||
import org.dromara.neutrinoproxy.server.dal.entity.JobInfoDO;
|
||||
import org.dromara.neutrinoproxy.server.util.ParamCheckUtil;
|
||||
import fun.asgc.solon.extend.job.IJobSource;
|
||||
import fun.asgc.solon.extend.job.JobInfo;
|
||||
import fun.asgc.solon.extend.job.impl.JobExecutor;
|
||||
@@ -19,17 +19,17 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.service;
|
||||
package org.dromara.neutrinoproxy.server.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import fun.asgc.neutrino.proxy.server.base.page.PageInfo;
|
||||
import fun.asgc.neutrino.proxy.server.base.page.PageQuery;
|
||||
import fun.asgc.neutrino.proxy.server.controller.req.log.JobLogListReq;
|
||||
import fun.asgc.neutrino.proxy.server.controller.res.log.JobLogListRes;
|
||||
import fun.asgc.neutrino.proxy.server.dal.JobLogMapper;
|
||||
import fun.asgc.neutrino.proxy.server.dal.entity.JobLogDO;
|
||||
import org.dromara.neutrinoproxy.server.base.page.PageInfo;
|
||||
import org.dromara.neutrinoproxy.server.base.page.PageQuery;
|
||||
import org.dromara.neutrinoproxy.server.controller.req.log.JobLogListReq;
|
||||
import org.dromara.neutrinoproxy.server.controller.res.log.JobLogListRes;
|
||||
import org.dromara.neutrinoproxy.server.dal.JobLogMapper;
|
||||
import org.dromara.neutrinoproxy.server.dal.entity.JobLogDO;
|
||||
import fun.asgc.solon.extend.job.IJobCallback;
|
||||
import fun.asgc.solon.extend.job.JobInfo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -1,4 +1,4 @@
|
||||
package fun.asgc.neutrino.proxy.server.service;
|
||||
package org.dromara.neutrinoproxy.server.service;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
@@ -6,28 +6,32 @@ import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.google.common.collect.Sets;
|
||||
import fun.asgc.neutrino.proxy.server.base.page.PageInfo;
|
||||
import fun.asgc.neutrino.proxy.server.base.page.PageQuery;
|
||||
import fun.asgc.neutrino.proxy.server.base.rest.SystemContextHolder;
|
||||
import fun.asgc.neutrino.proxy.server.constant.EnableStatusEnum;
|
||||
import fun.asgc.neutrino.proxy.server.constant.ExceptionConstant;
|
||||
import fun.asgc.neutrino.proxy.server.constant.OnlineStatusEnum;
|
||||
import fun.asgc.neutrino.proxy.server.controller.req.proxy.LicenseCreateReq;
|
||||
import fun.asgc.neutrino.proxy.server.controller.req.proxy.LicenseListReq;
|
||||
import fun.asgc.neutrino.proxy.server.controller.req.proxy.LicenseUpdateEnableStatusReq;
|
||||
import fun.asgc.neutrino.proxy.server.controller.req.proxy.LicenseUpdateReq;
|
||||
import fun.asgc.neutrino.proxy.server.controller.res.proxy.*;
|
||||
import fun.asgc.neutrino.proxy.server.dal.LicenseMapper;
|
||||
import fun.asgc.neutrino.proxy.server.dal.UserMapper;
|
||||
import fun.asgc.neutrino.proxy.server.dal.entity.LicenseDO;
|
||||
import fun.asgc.neutrino.proxy.server.dal.entity.UserDO;
|
||||
import fun.asgc.neutrino.proxy.server.util.ParamCheckUtil;
|
||||
import org.dromara.neutrinoproxy.server.base.db.DBInitialize;
|
||||
import org.dromara.neutrinoproxy.server.base.page.PageInfo;
|
||||
import org.dromara.neutrinoproxy.server.base.page.PageQuery;
|
||||
import org.dromara.neutrinoproxy.server.base.rest.SystemContextHolder;
|
||||
import org.dromara.neutrinoproxy.server.constant.EnableStatusEnum;
|
||||
import org.dromara.neutrinoproxy.server.constant.ExceptionConstant;
|
||||
import org.dromara.neutrinoproxy.server.constant.OnlineStatusEnum;
|
||||
import org.dromara.neutrinoproxy.server.controller.req.proxy.LicenseCreateReq;
|
||||
import org.dromara.neutrinoproxy.server.controller.req.proxy.LicenseListReq;
|
||||
import org.dromara.neutrinoproxy.server.controller.req.proxy.LicenseUpdateEnableStatusReq;
|
||||
import org.dromara.neutrinoproxy.server.controller.req.proxy.LicenseUpdateReq;
|
||||
import org.dromara.neutrinoproxy.server.controller.res.proxy.*;
|
||||
import org.dromara.neutrinoproxy.server.dal.LicenseMapper;
|
||||
import org.dromara.neutrinoproxy.server.dal.UserMapper;
|
||||
import org.dromara.neutrinoproxy.server.dal.entity.LicenseDO;
|
||||
import org.dromara.neutrinoproxy.server.dal.entity.UserDO;
|
||||
import org.dromara.neutrinoproxy.server.util.ParamCheckUtil;
|
||||
import ma.glasnost.orika.MapperFacade;
|
||||
import org.apache.ibatis.solon.annotation.Db;
|
||||
import org.dromara.neutrinoproxy.server.controller.res.proxy.*;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.noear.solon.annotation.Component;
|
||||
import org.noear.solon.annotation.Init;
|
||||
import org.noear.solon.annotation.Inject;
|
||||
import org.noear.solon.core.Lifecycle;
|
||||
import org.noear.solon.core.bean.LifecycleBean;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
@@ -39,7 +43,7 @@ import java.util.stream.Collectors;
|
||||
* @date: 2022/8/6
|
||||
*/
|
||||
@Component
|
||||
public class LicenseService implements Lifecycle {
|
||||
public class LicenseService implements LifecycleBean {
|
||||
@Inject
|
||||
private MapperFacade mapperFacade;
|
||||
@Db
|
||||
@@ -48,6 +52,8 @@ public class LicenseService implements Lifecycle {
|
||||
private UserMapper userMapper;
|
||||
@Inject
|
||||
private VisitorChannelService visitorChannelService;
|
||||
@Inject
|
||||
private DBInitialize dbInitialize;
|
||||
|
||||
public PageInfo<LicenseListRes> page(PageQuery pageQuery, LicenseListReq req) {
|
||||
Page<LicenseListRes> result = PageHelper.startPage(pageQuery.getCurrent(), pageQuery.getSize());
|
||||
@@ -215,9 +221,15 @@ public class LicenseService implements Lifecycle {
|
||||
/**
|
||||
* 服务端项目停止、启动时,更新在线状态为离线
|
||||
*/
|
||||
@Init
|
||||
public void init() {
|
||||
licenseMapper.updateOnlineStatus(OnlineStatusEnum.OFFLINE.getStatus(), new Date());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void start() throws Throwable {
|
||||
licenseMapper.updateOnlineStatus(OnlineStatusEnum.OFFLINE.getStatus(), new Date());
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1,26 +1,26 @@
|
||||
package fun.asgc.neutrino.proxy.server.service;
|
||||
package org.dromara.neutrinoproxy.server.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import fun.asgc.neutrino.proxy.server.base.page.PageInfo;
|
||||
import fun.asgc.neutrino.proxy.server.base.page.PageQuery;
|
||||
import fun.asgc.neutrino.proxy.server.base.rest.ServiceException;
|
||||
import fun.asgc.neutrino.proxy.server.base.rest.SystemContextHolder;
|
||||
import fun.asgc.neutrino.proxy.server.constant.Constants;
|
||||
import fun.asgc.neutrino.proxy.server.constant.EnableStatusEnum;
|
||||
import fun.asgc.neutrino.proxy.server.constant.ExceptionConstant;
|
||||
import fun.asgc.neutrino.proxy.server.controller.req.system.PortGroupCreateReq;
|
||||
import fun.asgc.neutrino.proxy.server.controller.req.system.PortGroupListReq;
|
||||
import fun.asgc.neutrino.proxy.server.controller.req.system.PortGroupUpdateEnableStatusReq;
|
||||
import fun.asgc.neutrino.proxy.server.controller.res.system.PortGroupCreateRes;
|
||||
import fun.asgc.neutrino.proxy.server.controller.res.system.PortGroupListRes;
|
||||
import fun.asgc.neutrino.proxy.server.controller.res.system.PortGroupUpdateEnableStatusRes;
|
||||
import fun.asgc.neutrino.proxy.server.dal.PortGroupMapper;
|
||||
import fun.asgc.neutrino.proxy.server.dal.PortPoolMapper;
|
||||
import fun.asgc.neutrino.proxy.server.dal.entity.PortGroupDO;
|
||||
import fun.asgc.neutrino.proxy.server.dal.entity.PortPoolDO;
|
||||
import fun.asgc.neutrino.proxy.server.util.ParamCheckUtil;
|
||||
import org.dromara.neutrinoproxy.server.base.page.PageInfo;
|
||||
import org.dromara.neutrinoproxy.server.base.page.PageQuery;
|
||||
import org.dromara.neutrinoproxy.server.base.rest.ServiceException;
|
||||
import org.dromara.neutrinoproxy.server.base.rest.SystemContextHolder;
|
||||
import org.dromara.neutrinoproxy.server.constant.Constants;
|
||||
import org.dromara.neutrinoproxy.server.constant.EnableStatusEnum;
|
||||
import org.dromara.neutrinoproxy.server.constant.ExceptionConstant;
|
||||
import org.dromara.neutrinoproxy.server.controller.req.system.PortGroupCreateReq;
|
||||
import org.dromara.neutrinoproxy.server.controller.req.system.PortGroupListReq;
|
||||
import org.dromara.neutrinoproxy.server.controller.req.system.PortGroupUpdateEnableStatusReq;
|
||||
import org.dromara.neutrinoproxy.server.controller.res.system.PortGroupCreateRes;
|
||||
import org.dromara.neutrinoproxy.server.controller.res.system.PortGroupListRes;
|
||||
import org.dromara.neutrinoproxy.server.controller.res.system.PortGroupUpdateEnableStatusRes;
|
||||
import org.dromara.neutrinoproxy.server.dal.PortGroupMapper;
|
||||
import org.dromara.neutrinoproxy.server.dal.PortPoolMapper;
|
||||
import org.dromara.neutrinoproxy.server.dal.entity.PortGroupDO;
|
||||
import org.dromara.neutrinoproxy.server.dal.entity.PortPoolDO;
|
||||
import org.dromara.neutrinoproxy.server.util.ParamCheckUtil;
|
||||
import ma.glasnost.orika.MapperFacade;
|
||||
import org.apache.ibatis.solon.annotation.Db;
|
||||
import org.noear.solon.annotation.Component;
|
||||
@@ -1,35 +1,44 @@
|
||||
package fun.asgc.neutrino.proxy.server.service;
|
||||
package org.dromara.neutrinoproxy.server.service;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.google.common.collect.Sets;
|
||||
import fun.asgc.neutrino.proxy.server.base.page.PageInfo;
|
||||
import fun.asgc.neutrino.proxy.server.base.page.PageQuery;
|
||||
import fun.asgc.neutrino.proxy.server.base.rest.SystemContextHolder;
|
||||
import fun.asgc.neutrino.proxy.server.constant.EnableStatusEnum;
|
||||
import fun.asgc.neutrino.proxy.server.constant.ExceptionConstant;
|
||||
import fun.asgc.neutrino.proxy.server.constant.OnlineStatusEnum;
|
||||
import fun.asgc.neutrino.proxy.server.controller.req.proxy.PortMappingCreateReq;
|
||||
import fun.asgc.neutrino.proxy.server.controller.req.proxy.PortMappingListReq;
|
||||
import fun.asgc.neutrino.proxy.server.controller.req.proxy.PortMappingUpdateEnableStatusReq;
|
||||
import fun.asgc.neutrino.proxy.server.controller.req.proxy.PortMappingUpdateReq;
|
||||
import fun.asgc.neutrino.proxy.server.controller.res.proxy.*;
|
||||
import fun.asgc.neutrino.proxy.server.dal.LicenseMapper;
|
||||
import fun.asgc.neutrino.proxy.server.dal.PortMappingMapper;
|
||||
import fun.asgc.neutrino.proxy.server.dal.PortPoolMapper;
|
||||
import fun.asgc.neutrino.proxy.server.dal.UserMapper;
|
||||
import fun.asgc.neutrino.proxy.server.dal.entity.LicenseDO;
|
||||
import fun.asgc.neutrino.proxy.server.dal.entity.PortMappingDO;
|
||||
import fun.asgc.neutrino.proxy.server.dal.entity.PortPoolDO;
|
||||
import fun.asgc.neutrino.proxy.server.dal.entity.UserDO;
|
||||
import fun.asgc.neutrino.proxy.server.util.ParamCheckUtil;
|
||||
import org.dromara.neutrinoproxy.server.base.db.DBInitialize;
|
||||
import org.dromara.neutrinoproxy.server.base.page.PageInfo;
|
||||
import org.dromara.neutrinoproxy.server.base.page.PageQuery;
|
||||
import org.dromara.neutrinoproxy.server.base.proxy.ProxyConfig;
|
||||
import org.dromara.neutrinoproxy.server.base.rest.SystemContextHolder;
|
||||
import org.dromara.neutrinoproxy.server.constant.EnableStatusEnum;
|
||||
import org.dromara.neutrinoproxy.server.constant.ExceptionConstant;
|
||||
import org.dromara.neutrinoproxy.server.constant.NetworkProtocolEnum;
|
||||
import org.dromara.neutrinoproxy.server.constant.OnlineStatusEnum;
|
||||
import org.dromara.neutrinoproxy.server.controller.req.proxy.PortMappingCreateReq;
|
||||
import org.dromara.neutrinoproxy.server.controller.req.proxy.PortMappingListReq;
|
||||
import org.dromara.neutrinoproxy.server.controller.req.proxy.PortMappingUpdateEnableStatusReq;
|
||||
import org.dromara.neutrinoproxy.server.controller.req.proxy.PortMappingUpdateReq;
|
||||
import org.dromara.neutrinoproxy.server.controller.res.proxy.*;
|
||||
import org.dromara.neutrinoproxy.server.dal.LicenseMapper;
|
||||
import org.dromara.neutrinoproxy.server.dal.PortMappingMapper;
|
||||
import org.dromara.neutrinoproxy.server.dal.PortPoolMapper;
|
||||
import org.dromara.neutrinoproxy.server.dal.UserMapper;
|
||||
import org.dromara.neutrinoproxy.server.dal.entity.LicenseDO;
|
||||
import org.dromara.neutrinoproxy.server.dal.entity.PortMappingDO;
|
||||
import org.dromara.neutrinoproxy.server.dal.entity.PortPoolDO;
|
||||
import org.dromara.neutrinoproxy.server.dal.entity.UserDO;
|
||||
import org.dromara.neutrinoproxy.server.util.ParamCheckUtil;
|
||||
import ma.glasnost.orika.MapperFacade;
|
||||
import org.apache.ibatis.solon.annotation.Db;
|
||||
import org.dromara.neutrinoproxy.server.controller.res.proxy.*;
|
||||
import org.dromara.neutrinoproxy.server.util.ProxyUtil;
|
||||
import org.noear.solon.annotation.Component;
|
||||
import org.noear.solon.annotation.Init;
|
||||
import org.noear.solon.annotation.Inject;
|
||||
import org.noear.solon.core.Lifecycle;
|
||||
import org.noear.solon.core.bean.LifecycleBean;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
@@ -41,7 +50,7 @@ import java.util.stream.Collectors;
|
||||
* @date: 2022/8/8
|
||||
*/
|
||||
@Component
|
||||
public class PortMappingService implements Lifecycle {
|
||||
public class PortMappingService implements LifecycleBean {
|
||||
@Inject
|
||||
private MapperFacade mapperFacade;
|
||||
@Db
|
||||
@@ -57,6 +66,10 @@ public class PortMappingService implements Lifecycle {
|
||||
|
||||
@Inject
|
||||
private PortPoolService portPoolService;
|
||||
@Inject
|
||||
private ProxyConfig proxyConfig;
|
||||
@Inject
|
||||
private DBInitialize dbInitialize;
|
||||
|
||||
public PageInfo<PortMappingListRes> page(PageQuery pageQuery, PortMappingListReq req) {
|
||||
Page<PortMappingListRes> result = PageHelper.startPage(pageQuery.getCurrent(), pageQuery.getSize());
|
||||
@@ -89,6 +102,9 @@ public class PortMappingService implements Lifecycle {
|
||||
return;
|
||||
}
|
||||
item.setUserName(user.getName());
|
||||
if (StrUtil.isNotBlank(proxyConfig.getServer().getDomainName()) && StrUtil.isNotBlank(item.getSubdomain())) {
|
||||
item.setDomain(item.getSubdomain() + "." + proxyConfig.getServer().getDomainName());
|
||||
}
|
||||
});
|
||||
//sorted [userId asc] [licenseId asc] [createTime asc]
|
||||
respList = respList.stream().sorted(Comparator.comparing(PortMappingListRes::getUserId)
|
||||
@@ -108,11 +124,13 @@ public class PortMappingService implements Lifecycle {
|
||||
PortPoolDO portPoolDO = portPoolMapper.findByPort(req.getServerPort());
|
||||
ParamCheckUtil.checkNotNull(portPoolDO, ExceptionConstant.PORT_NOT_EXIST);
|
||||
ParamCheckUtil.checkExpression(null == portMappingMapper.findByPort(req.getServerPort(), null), ExceptionConstant.PORT_CANNOT_REPEAT_MAPPING, req.getServerPort());
|
||||
|
||||
ParamCheckUtil.checkExpression(!portMappingMapper.checkRepeatBySubdomain(req.getSubdomain(), null), ExceptionConstant.PORT_MAPPING_SUBDONAME_CONNOT_REPEAT);
|
||||
|
||||
Date now = new Date();
|
||||
PortMappingDO portMappingDO = new PortMappingDO();
|
||||
portMappingDO.setLicenseId(req.getLicenseId());
|
||||
portMappingDO.setProtocal(req.getProtocal());
|
||||
portMappingDO.setSubdomain(req.getSubdomain());
|
||||
portMappingDO.setServerPort(req.getServerPort());
|
||||
portMappingDO.setClientIp(req.getClientIp());
|
||||
portMappingDO.setClientPort(req.getClientPort());
|
||||
@@ -123,6 +141,12 @@ public class PortMappingService implements Lifecycle {
|
||||
portMappingMapper.insert(portMappingDO);
|
||||
// 更新VisitorChannel
|
||||
visitorChannelService.addVisitorChannelByPortMapping(portMappingDO);
|
||||
// 更新域名映射
|
||||
if (NetworkProtocolEnum.HTTP.getDesc().equals(portMappingDO.getProtocal()) &&
|
||||
StrUtil.isNotBlank(proxyConfig.getServer().getDomainName()) &&
|
||||
StrUtil.isNotBlank(portMappingDO.getSubdomain())) {
|
||||
ProxyUtil.setSubdomainToServerPort(portMappingDO.getSubdomain(), portMappingDO.getServerPort());
|
||||
}
|
||||
return new PortMappingCreateRes();
|
||||
}
|
||||
|
||||
@@ -136,6 +160,7 @@ public class PortMappingService implements Lifecycle {
|
||||
PortPoolDO portPoolDO = portPoolMapper.findByPort(req.getServerPort());
|
||||
ParamCheckUtil.checkNotNull(portPoolDO, ExceptionConstant.PORT_NOT_EXIST);
|
||||
ParamCheckUtil.checkExpression(null == portMappingMapper.findByPort(req.getServerPort(), Sets.newHashSet(req.getId())), ExceptionConstant.PORT_CANNOT_REPEAT_MAPPING, req.getServerPort());
|
||||
ParamCheckUtil.checkExpression(!portMappingMapper.checkRepeatBySubdomain(req.getSubdomain(), Sets.newHashSet(req.getId())), ExceptionConstant.PORT_MAPPING_SUBDONAME_CONNOT_REPEAT);
|
||||
|
||||
// 查询原端口映射
|
||||
PortMappingDO oldPortMappingDO = portMappingMapper.findById(req.getId());
|
||||
@@ -143,6 +168,8 @@ public class PortMappingService implements Lifecycle {
|
||||
|
||||
PortMappingDO portMappingDO = new PortMappingDO();
|
||||
portMappingDO.setId(req.getId());
|
||||
portMappingDO.setProtocal(req.getProtocal());
|
||||
portMappingDO.setSubdomain(req.getSubdomain());
|
||||
portMappingDO.setLicenseId(req.getLicenseId());
|
||||
portMappingDO.setServerPort(req.getServerPort());
|
||||
portMappingDO.setClientIp(req.getClientIp());
|
||||
@@ -152,6 +179,17 @@ public class PortMappingService implements Lifecycle {
|
||||
portMappingMapper.updateById(portMappingDO);
|
||||
// 更新VisitorChannel
|
||||
visitorChannelService.updateVisitorChannelByPortMapping(oldPortMappingDO, portMappingDO);
|
||||
// 删除老的域名映射
|
||||
if (NetworkProtocolEnum.HTTP.getDesc().equals(oldPortMappingDO.getProtocal()) &&
|
||||
StrUtil.isNotBlank(oldPortMappingDO.getSubdomain())) {
|
||||
ProxyUtil.removeSubdomainToServerPort(oldPortMappingDO.getSubdomain());
|
||||
}
|
||||
// 更新域名映射
|
||||
if (NetworkProtocolEnum.HTTP.getDesc().equals(portMappingDO.getProtocal()) &&
|
||||
StrUtil.isNotBlank(proxyConfig.getServer().getDomainName()) &&
|
||||
StrUtil.isNotBlank(portMappingDO.getSubdomain())) {
|
||||
ProxyUtil.setSubdomainToServerPort(portMappingDO.getSubdomain(), portMappingDO.getServerPort());
|
||||
}
|
||||
return new PortMappingUpdateRes();
|
||||
}
|
||||
|
||||
@@ -221,6 +259,11 @@ public class PortMappingService implements Lifecycle {
|
||||
|
||||
// 更新VisitorChannel
|
||||
visitorChannelService.removeVisitorChannelByPortMapping(portMappingDO);
|
||||
// 更新域名映射
|
||||
if (NetworkProtocolEnum.HTTP.getDesc().equals(portMappingDO.getProtocal()) &&
|
||||
StrUtil.isNotBlank(portMappingDO.getSubdomain())) {
|
||||
ProxyUtil.removeSubdomainToServerPort(portMappingDO.getSubdomain());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -235,9 +278,32 @@ public class PortMappingService implements Lifecycle {
|
||||
/**
|
||||
* 服务端项目停止、启动时,更新在线状态为离线
|
||||
*/
|
||||
@Init
|
||||
public void init() {
|
||||
portMappingMapper.updateOnlineStatus(OnlineStatusEnum.OFFLINE.getStatus(), new Date());
|
||||
|
||||
// 未配置域名,则不需要处理域名映射逻辑
|
||||
if (StrUtil.isBlank(proxyConfig.getServer().getDomainName())) {
|
||||
return;
|
||||
}
|
||||
List<PortMappingDO> portMappingDOList = portMappingMapper.selectList(new LambdaQueryWrapper<PortMappingDO>()
|
||||
.eq(PortMappingDO::getProtocal, NetworkProtocolEnum.HTTP.getDesc())
|
||||
.isNotNull(PortMappingDO::getSubdomain)
|
||||
);
|
||||
if (CollectionUtil.isEmpty(portMappingDOList)) {
|
||||
return;
|
||||
}
|
||||
portMappingDOList.forEach(item -> {
|
||||
if (StrUtil.isBlank(item.getSubdomain())) {
|
||||
return;
|
||||
}
|
||||
ProxyUtil.setSubdomainToServerPort(item.getSubdomain(), item.getServerPort());
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start() throws Throwable {
|
||||
portMappingMapper.updateOnlineStatus(OnlineStatusEnum.OFFLINE.getStatus(), new Date());
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1,38 +1,50 @@
|
||||
package fun.asgc.neutrino.proxy.server.service;
|
||||
package org.dromara.neutrinoproxy.server.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import fun.asgc.neutrino.proxy.server.base.page.PageInfo;
|
||||
import fun.asgc.neutrino.proxy.server.base.page.PageQuery;
|
||||
import fun.asgc.neutrino.proxy.server.base.rest.ServiceException;
|
||||
import fun.asgc.neutrino.proxy.server.constant.EnableStatusEnum;
|
||||
import fun.asgc.neutrino.proxy.server.constant.ExceptionConstant;
|
||||
import fun.asgc.neutrino.proxy.server.controller.req.system.*;
|
||||
import fun.asgc.neutrino.proxy.server.controller.res.system.*;
|
||||
import fun.asgc.neutrino.proxy.server.dal.LicenseMapper;
|
||||
import fun.asgc.neutrino.proxy.server.dal.PortGroupMapper;
|
||||
import fun.asgc.neutrino.proxy.server.dal.PortMappingMapper;
|
||||
import fun.asgc.neutrino.proxy.server.dal.PortPoolMapper;
|
||||
import fun.asgc.neutrino.proxy.server.dal.entity.*;
|
||||
import fun.asgc.neutrino.proxy.server.util.ParamCheckUtil;
|
||||
import org.dromara.neutrinoproxy.server.base.page.PageInfo;
|
||||
import org.dromara.neutrinoproxy.server.base.page.PageQuery;
|
||||
import org.dromara.neutrinoproxy.server.base.rest.ServiceException;
|
||||
import org.dromara.neutrinoproxy.server.constant.EnableStatusEnum;
|
||||
import org.dromara.neutrinoproxy.server.constant.ExceptionConstant;
|
||||
import org.dromara.neutrinoproxy.server.controller.req.system.*;
|
||||
import org.dromara.neutrinoproxy.server.controller.res.system.*;
|
||||
import org.dromara.neutrinoproxy.server.dal.LicenseMapper;
|
||||
import org.dromara.neutrinoproxy.server.dal.PortGroupMapper;
|
||||
import org.dromara.neutrinoproxy.server.dal.PortMappingMapper;
|
||||
import org.dromara.neutrinoproxy.server.dal.PortPoolMapper;
|
||||
import org.dromara.neutrinoproxy.server.dal.entity.*;
|
||||
import org.dromara.neutrinoproxy.server.dal.entity.LicenseDO;
|
||||
import org.dromara.neutrinoproxy.server.dal.entity.PortMappingDO;
|
||||
import org.dromara.neutrinoproxy.server.dal.entity.PortPoolDO;
|
||||
import org.dromara.neutrinoproxy.server.util.ParamCheckUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import ma.glasnost.orika.MapperFacade;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.ibatis.solon.annotation.Db;
|
||||
import org.dromara.neutrinoproxy.server.controller.req.system.*;
|
||||
import org.dromara.neutrinoproxy.server.controller.res.system.*;
|
||||
import org.dromara.neutrinoproxy.server.dal.entity.PortGroupDO;
|
||||
import org.noear.solon.annotation.Component;
|
||||
import org.noear.solon.annotation.Inject;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static org.dromara.neutrinoproxy.server.constant.ExceptionConstant.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author: aoshiguchen
|
||||
* @date: 2022/8/7
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class PortPoolService {
|
||||
@Inject
|
||||
@@ -83,23 +95,38 @@ public class PortPoolService {
|
||||
}
|
||||
|
||||
public PortPoolCreateRes create(PortPoolCreateReq req) {
|
||||
PortPoolDO oldPortPoolDO = portPoolMapper.findByPort(req.getPort());
|
||||
ParamCheckUtil.checkMustNull(oldPortPoolDO, ExceptionConstant.PORT_CANNOT_REPEAT);
|
||||
PortGroupDO portGroupDO = portGroupMapper.selectById(req.getGroupId());
|
||||
ParamCheckUtil.checkNotNull(portGroupDO, ExceptionConstant.PORT_GROUP_NAME_DOES_NOT_EXIST);
|
||||
|
||||
Date now = new Date();
|
||||
|
||||
portPoolMapper.insert(new PortPoolDO()
|
||||
.setPort(req.getPort())
|
||||
.setGroupId(req.getGroupId())
|
||||
.setEnable(EnableStatusEnum.ENABLE.getStatus())
|
||||
.setCreateTime(now)
|
||||
.setUpdateTime(now)
|
||||
);
|
||||
// 更新visitorChannel
|
||||
visitorChannelService.updateVisitorChannelByPortPool(req.getPort(), EnableStatusEnum.ENABLE.getStatus());
|
||||
|
||||
Consumer<Integer> consumer = port -> {
|
||||
PortPoolDO oldPortPoolDO = portPoolMapper.findByPort(port);
|
||||
ParamCheckUtil.checkMustNull(oldPortPoolDO, PORT_CANNOT_REPEAT);
|
||||
PortGroupDO portGroupDO = portGroupMapper.selectById(req.getGroupId());
|
||||
ParamCheckUtil.checkNotNull(portGroupDO, PORT_GROUP_NAME_DOES_NOT_EXIST);
|
||||
Date now = new Date();
|
||||
portPoolMapper.insert(new PortPoolDO()
|
||||
.setPort(port)
|
||||
.setGroupId(req.getGroupId())
|
||||
.setEnable(EnableStatusEnum.ENABLE.getStatus())
|
||||
.setCreateTime(now)
|
||||
.setUpdateTime(now)
|
||||
);
|
||||
// 更新visitorChannel
|
||||
visitorChannelService.updateVisitorChannelByPortPool(port, EnableStatusEnum.ENABLE.getStatus());
|
||||
};
|
||||
String[] portArr = StringUtils.split(req.getPort(), "-");
|
||||
if(portArr.length == 1){
|
||||
Integer port = Integer.valueOf(portArr[0]);
|
||||
consumer.accept(port);
|
||||
}else if(portArr.length == 2){
|
||||
int min = Integer.parseInt(portArr[0]),max = Integer.parseInt(portArr[1]);
|
||||
for (int i = min; i <= max; i++) {
|
||||
try {
|
||||
consumer.accept(i);
|
||||
} catch (Exception e) {
|
||||
log.warn("bulk add port err:{}",e.getMessage());
|
||||
}
|
||||
}
|
||||
}else{
|
||||
throw ServiceException.create(PORT_RANGE_FAIL);
|
||||
}
|
||||
return new PortPoolCreateRes();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
package org.dromara.neutrinoproxy.server.service;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.neutrinoproxy.server.controller.res.system.ProtocalListRes;
|
||||
import org.noear.solon.annotation.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author: aoshiguchen
|
||||
* @date: 2023/4/2
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class ProtocalService {
|
||||
|
||||
/**
|
||||
* 获取协议列表
|
||||
* @return
|
||||
*/
|
||||
public List<ProtocalListRes> list() {
|
||||
return Lists.newArrayList(
|
||||
new ProtocalListRes().setName("TCP").setEnable(Boolean.TRUE).setRemark("支持一切TCP之上的协议"),
|
||||
new ProtocalListRes().setName("HTTP").setEnable(Boolean.TRUE).setRemark("支持绑定子域名,未绑定时等价于时使用TCP"),
|
||||
new ProtocalListRes().setName("UDP").setEnable(Boolean.FALSE).setRemark("暂不支持")
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -19,12 +19,12 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.service;
|
||||
package org.dromara.neutrinoproxy.server.service;
|
||||
|
||||
import fun.asgc.neutrino.proxy.server.constant.OnlineStatusEnum;
|
||||
import fun.asgc.neutrino.proxy.server.dal.LicenseMapper;
|
||||
import fun.asgc.neutrino.proxy.server.dal.PortMappingMapper;
|
||||
import fun.asgc.neutrino.proxy.server.proxy.domain.CmdChannelAttachInfo;
|
||||
import org.dromara.neutrinoproxy.server.constant.OnlineStatusEnum;
|
||||
import org.dromara.neutrinoproxy.server.dal.LicenseMapper;
|
||||
import org.dromara.neutrinoproxy.server.dal.PortMappingMapper;
|
||||
import org.dromara.neutrinoproxy.server.proxy.domain.CmdChannelAttachInfo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.ibatis.solon.annotation.Db;
|
||||
import org.noear.solon.annotation.Component;
|
||||
@@ -1,29 +1,29 @@
|
||||
package fun.asgc.neutrino.proxy.server.service;
|
||||
package org.dromara.neutrinoproxy.server.service;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.google.common.collect.Lists;
|
||||
import fun.asgc.neutrino.proxy.core.util.DateUtil;
|
||||
import fun.asgc.neutrino.proxy.server.base.db.DbConfig;
|
||||
import fun.asgc.neutrino.proxy.server.base.page.PageInfo;
|
||||
import fun.asgc.neutrino.proxy.server.base.page.PageQuery;
|
||||
import fun.asgc.neutrino.proxy.server.constant.Constants;
|
||||
import fun.asgc.neutrino.proxy.server.constant.OnlineStatusEnum;
|
||||
import fun.asgc.neutrino.proxy.server.controller.req.report.LicenseFlowMonthReportReq;
|
||||
import fun.asgc.neutrino.proxy.server.controller.req.report.LicenseFlowReportReq;
|
||||
import fun.asgc.neutrino.proxy.server.controller.req.report.UserFlowMonthReportReq;
|
||||
import fun.asgc.neutrino.proxy.server.controller.req.report.UserFlowReportReq;
|
||||
import fun.asgc.neutrino.proxy.server.controller.res.report.*;
|
||||
import fun.asgc.neutrino.proxy.server.dal.LicenseMapper;
|
||||
import fun.asgc.neutrino.proxy.server.dal.PortMappingMapper;
|
||||
import fun.asgc.neutrino.proxy.server.dal.ReportMapper;
|
||||
import fun.asgc.neutrino.proxy.server.dal.entity.LicenseDO;
|
||||
import fun.asgc.neutrino.proxy.server.dal.entity.PortMappingDO;
|
||||
import fun.asgc.neutrino.proxy.server.service.bo.FlowBO;
|
||||
import fun.asgc.neutrino.proxy.server.service.bo.SingleDayFlowBO;
|
||||
import fun.asgc.neutrino.proxy.server.util.FormatUtil;
|
||||
import org.dromara.neutrinoproxy.core.util.DateUtil;
|
||||
import org.dromara.neutrinoproxy.server.base.db.DbConfig;
|
||||
import org.dromara.neutrinoproxy.server.base.page.PageInfo;
|
||||
import org.dromara.neutrinoproxy.server.base.page.PageQuery;
|
||||
import org.dromara.neutrinoproxy.server.constant.Constants;
|
||||
import org.dromara.neutrinoproxy.server.constant.OnlineStatusEnum;
|
||||
import org.dromara.neutrinoproxy.server.controller.req.report.LicenseFlowMonthReportReq;
|
||||
import org.dromara.neutrinoproxy.server.controller.req.report.LicenseFlowReportReq;
|
||||
import org.dromara.neutrinoproxy.server.controller.req.report.UserFlowMonthReportReq;
|
||||
import org.dromara.neutrinoproxy.server.controller.req.report.UserFlowReportReq;
|
||||
import org.dromara.neutrinoproxy.server.controller.res.report.*;
|
||||
import org.dromara.neutrinoproxy.server.dal.LicenseMapper;
|
||||
import org.dromara.neutrinoproxy.server.dal.PortMappingMapper;
|
||||
import org.dromara.neutrinoproxy.server.dal.ReportMapper;
|
||||
import org.dromara.neutrinoproxy.server.dal.entity.LicenseDO;
|
||||
import org.dromara.neutrinoproxy.server.dal.entity.PortMappingDO;
|
||||
import org.dromara.neutrinoproxy.server.service.bo.FlowBO;
|
||||
import org.dromara.neutrinoproxy.server.service.bo.SingleDayFlowBO;
|
||||
import org.dromara.neutrinoproxy.server.util.FormatUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import ma.glasnost.orika.MapperFacade;
|
||||
import org.apache.ibatis.solon.annotation.Db;
|
||||
@@ -1,18 +1,18 @@
|
||||
package fun.asgc.neutrino.proxy.server.service;
|
||||
package org.dromara.neutrinoproxy.server.service;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import fun.asgc.neutrino.proxy.server.base.page.PageInfo;
|
||||
import fun.asgc.neutrino.proxy.server.base.page.PageQuery;
|
||||
import fun.asgc.neutrino.proxy.server.controller.req.log.UserLoginRecordListReq;
|
||||
import fun.asgc.neutrino.proxy.server.controller.res.log.UserLoginRecordListRes;
|
||||
import fun.asgc.neutrino.proxy.server.dal.UserLoginRecordMapper;
|
||||
import fun.asgc.neutrino.proxy.server.dal.UserMapper;
|
||||
import fun.asgc.neutrino.proxy.server.dal.entity.UserDO;
|
||||
import fun.asgc.neutrino.proxy.server.dal.entity.UserLoginRecordDO;
|
||||
import org.dromara.neutrinoproxy.server.base.page.PageInfo;
|
||||
import org.dromara.neutrinoproxy.server.base.page.PageQuery;
|
||||
import org.dromara.neutrinoproxy.server.controller.req.log.UserLoginRecordListReq;
|
||||
import org.dromara.neutrinoproxy.server.controller.res.log.UserLoginRecordListRes;
|
||||
import org.dromara.neutrinoproxy.server.dal.UserLoginRecordMapper;
|
||||
import org.dromara.neutrinoproxy.server.dal.UserMapper;
|
||||
import org.dromara.neutrinoproxy.server.dal.entity.UserDO;
|
||||
import org.dromara.neutrinoproxy.server.dal.entity.UserLoginRecordDO;
|
||||
import ma.glasnost.orika.MapperFacade;
|
||||
import org.apache.ibatis.solon.annotation.Db;
|
||||
import org.noear.solon.annotation.Component;
|
||||
@@ -1,26 +1,26 @@
|
||||
package fun.asgc.neutrino.proxy.server.service;
|
||||
package org.dromara.neutrinoproxy.server.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import fun.asgc.neutrino.proxy.core.util.DateUtil;
|
||||
import fun.asgc.neutrino.proxy.server.base.page.PageInfo;
|
||||
import fun.asgc.neutrino.proxy.server.base.page.PageQuery;
|
||||
import fun.asgc.neutrino.proxy.server.base.rest.ServiceException;
|
||||
import fun.asgc.neutrino.proxy.server.base.rest.SystemContextHolder;
|
||||
import fun.asgc.neutrino.proxy.server.constant.EnableStatusEnum;
|
||||
import fun.asgc.neutrino.proxy.server.constant.ExceptionConstant;
|
||||
import fun.asgc.neutrino.proxy.server.controller.req.system.*;
|
||||
import fun.asgc.neutrino.proxy.server.controller.res.system.*;
|
||||
import fun.asgc.neutrino.proxy.server.dal.UserLoginRecordMapper;
|
||||
import fun.asgc.neutrino.proxy.server.dal.UserMapper;
|
||||
import fun.asgc.neutrino.proxy.server.dal.UserTokenMapper;
|
||||
import fun.asgc.neutrino.proxy.server.dal.entity.UserDO;
|
||||
import fun.asgc.neutrino.proxy.server.dal.entity.UserLoginRecordDO;
|
||||
import fun.asgc.neutrino.proxy.server.dal.entity.UserTokenDO;
|
||||
import fun.asgc.neutrino.proxy.server.util.Md5Util;
|
||||
import fun.asgc.neutrino.proxy.server.util.ParamCheckUtil;
|
||||
import org.dromara.neutrinoproxy.core.util.DateUtil;
|
||||
import org.dromara.neutrinoproxy.server.base.page.PageInfo;
|
||||
import org.dromara.neutrinoproxy.server.base.page.PageQuery;
|
||||
import org.dromara.neutrinoproxy.server.base.rest.ServiceException;
|
||||
import org.dromara.neutrinoproxy.server.base.rest.SystemContextHolder;
|
||||
import org.dromara.neutrinoproxy.server.constant.EnableStatusEnum;
|
||||
import org.dromara.neutrinoproxy.server.constant.ExceptionConstant;
|
||||
import org.dromara.neutrinoproxy.server.controller.req.system.*;
|
||||
import org.dromara.neutrinoproxy.server.controller.res.system.*;
|
||||
import org.dromara.neutrinoproxy.server.dal.UserLoginRecordMapper;
|
||||
import org.dromara.neutrinoproxy.server.dal.UserMapper;
|
||||
import org.dromara.neutrinoproxy.server.dal.UserTokenMapper;
|
||||
import org.dromara.neutrinoproxy.server.dal.entity.UserDO;
|
||||
import org.dromara.neutrinoproxy.server.dal.entity.UserLoginRecordDO;
|
||||
import org.dromara.neutrinoproxy.server.dal.entity.UserTokenDO;
|
||||
import org.dromara.neutrinoproxy.server.util.Md5Util;
|
||||
import org.dromara.neutrinoproxy.server.util.ParamCheckUtil;
|
||||
import ma.glasnost.orika.MapperFacade;
|
||||
import org.apache.ibatis.solon.annotation.Db;
|
||||
import org.noear.solon.annotation.Component;
|
||||
@@ -1,23 +1,23 @@
|
||||
package fun.asgc.neutrino.proxy.server.service;
|
||||
package org.dromara.neutrinoproxy.server.service;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Sets;
|
||||
import fun.asgc.neutrino.proxy.core.Constants;
|
||||
import fun.asgc.neutrino.proxy.server.constant.EnableStatusEnum;
|
||||
import fun.asgc.neutrino.proxy.server.dal.LicenseMapper;
|
||||
import fun.asgc.neutrino.proxy.server.dal.PortMappingMapper;
|
||||
import fun.asgc.neutrino.proxy.server.dal.PortPoolMapper;
|
||||
import fun.asgc.neutrino.proxy.server.dal.UserMapper;
|
||||
import fun.asgc.neutrino.proxy.server.dal.entity.LicenseDO;
|
||||
import fun.asgc.neutrino.proxy.server.dal.entity.PortMappingDO;
|
||||
import fun.asgc.neutrino.proxy.server.dal.entity.PortPoolDO;
|
||||
import fun.asgc.neutrino.proxy.server.dal.entity.UserDO;
|
||||
import fun.asgc.neutrino.proxy.server.proxy.core.BytesMetricsHandler;
|
||||
import fun.asgc.neutrino.proxy.server.proxy.core.VisitorChannelHandler;
|
||||
import fun.asgc.neutrino.proxy.server.proxy.domain.CmdChannelAttachInfo;
|
||||
import fun.asgc.neutrino.proxy.server.proxy.domain.ProxyMapping;
|
||||
import fun.asgc.neutrino.proxy.server.util.ProxyUtil;
|
||||
import org.dromara.neutrinoproxy.core.Constants;
|
||||
import org.dromara.neutrinoproxy.server.constant.EnableStatusEnum;
|
||||
import org.dromara.neutrinoproxy.server.dal.LicenseMapper;
|
||||
import org.dromara.neutrinoproxy.server.dal.PortMappingMapper;
|
||||
import org.dromara.neutrinoproxy.server.dal.PortPoolMapper;
|
||||
import org.dromara.neutrinoproxy.server.dal.UserMapper;
|
||||
import org.dromara.neutrinoproxy.server.dal.entity.LicenseDO;
|
||||
import org.dromara.neutrinoproxy.server.dal.entity.PortMappingDO;
|
||||
import org.dromara.neutrinoproxy.server.dal.entity.PortPoolDO;
|
||||
import org.dromara.neutrinoproxy.server.dal.entity.UserDO;
|
||||
import org.dromara.neutrinoproxy.server.proxy.core.BytesMetricsHandler;
|
||||
import org.dromara.neutrinoproxy.server.proxy.core.VisitorChannelHandler;
|
||||
import org.dromara.neutrinoproxy.server.proxy.domain.CmdChannelAttachInfo;
|
||||
import org.dromara.neutrinoproxy.server.proxy.domain.ProxyMapping;
|
||||
import org.dromara.neutrinoproxy.server.util.ProxyUtil;
|
||||
import io.netty.bootstrap.ServerBootstrap;
|
||||
import io.netty.channel.Channel;
|
||||
import io.netty.channel.ChannelInitializer;
|
||||
@@ -1,4 +1,4 @@
|
||||
package fun.asgc.neutrino.proxy.server.service.bo;
|
||||
package org.dromara.neutrinoproxy.server.service.bo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package fun.asgc.neutrino.proxy.server.service.bo;
|
||||
package org.dromara.neutrinoproxy.server.service.bo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package fun.asgc.neutrino.proxy.server.util;
|
||||
package org.dromara.neutrinoproxy.server.util;
|
||||
|
||||
/**
|
||||
* @author: aoshiguchen
|
||||
@@ -19,7 +19,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.util;
|
||||
package org.dromara.neutrinoproxy.server.util;
|
||||
|
||||
import java.math.BigInteger;
|
||||
import java.security.MessageDigest;
|
||||
@@ -1,8 +1,8 @@
|
||||
package fun.asgc.neutrino.proxy.server.util;
|
||||
package org.dromara.neutrinoproxy.server.util;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import fun.asgc.neutrino.proxy.server.constant.ExceptionConstant;
|
||||
import fun.asgc.neutrino.proxy.server.base.rest.ServiceException;
|
||||
import org.dromara.neutrinoproxy.server.constant.ExceptionConstant;
|
||||
import org.dromara.neutrinoproxy.server.base.rest.ServiceException;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
@@ -1,17 +1,19 @@
|
||||
package fun.asgc.neutrino.proxy.server.util;
|
||||
package org.dromara.neutrinoproxy.server.util;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.google.common.collect.Sets;
|
||||
import fun.asgc.neutrino.proxy.core.ChannelAttribute;
|
||||
import fun.asgc.neutrino.proxy.server.proxy.domain.CmdChannelAttachInfo;
|
||||
import fun.asgc.neutrino.proxy.server.proxy.domain.ProxyMapping;
|
||||
import fun.asgc.neutrino.proxy.server.proxy.domain.VisitorChannelAttachInfo;
|
||||
import org.dromara.neutrinoproxy.core.ChannelAttribute;
|
||||
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.VisitorChannelAttachInfo;
|
||||
import io.netty.channel.Channel;
|
||||
import io.netty.util.AttributeKey;
|
||||
|
||||
import java.net.InetSocketAddress;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
import java.util.concurrent.locks.ReadWriteLock;
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||
|
||||
@@ -47,6 +49,18 @@ public class ProxyUtil {
|
||||
* cmdChannelAttachInfo.getUserChannelMap() 读写锁
|
||||
*/
|
||||
private static final ReadWriteLock userChannelMapLock = new ReentrantReadWriteLock();
|
||||
/**
|
||||
* 访问者ID生成器
|
||||
*/
|
||||
private static AtomicLong visitorIdProducer = new AtomicLong(0);
|
||||
/**
|
||||
* 代理 - connect附加映射
|
||||
*/
|
||||
private static Map<String, ProxyAttachment> proxyConnectAttachmentMap = new HashMap<>();
|
||||
/**
|
||||
* 子域名 - 服务端端口映射
|
||||
*/
|
||||
private static Map<String, Integer> subdomainToServerPort = new HashMap<>();
|
||||
|
||||
/**
|
||||
* 初始化代理信息
|
||||
@@ -278,4 +292,65 @@ public class ProxyUtil {
|
||||
}
|
||||
return channel.attr(CHANNEL_ATTR_KEY).get().get("attachInfo");
|
||||
}
|
||||
|
||||
/**
|
||||
* 为访问者连接产生ID
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static String newVisitorId() {
|
||||
return String.valueOf(visitorIdProducer.incrementAndGet());
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加代理附加对象
|
||||
* @param visitorId
|
||||
* @param proxyAttachment
|
||||
*/
|
||||
public static void addProxyConnectAttachment(String visitorId, ProxyAttachment proxyAttachment) {
|
||||
proxyConnectAttachmentMap.put(visitorId, proxyAttachment);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取代理附加对象
|
||||
* @param visitorId
|
||||
* @return
|
||||
*/
|
||||
public static ProxyAttachment getProxyConnectAttachment(String visitorId) {
|
||||
return proxyConnectAttachmentMap.get(visitorId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除代理附加对象
|
||||
* @param visitorId
|
||||
*/
|
||||
public static void remoteProxyConnectAttachment(String visitorId) {
|
||||
proxyConnectAttachmentMap.remove(visitorId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置子域名到服务端端口的映射
|
||||
* @param subdomain
|
||||
* @param serverPort
|
||||
*/
|
||||
public static void setSubdomainToServerPort(String subdomain, Integer serverPort) {
|
||||
subdomainToServerPort.put(subdomain, serverPort);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除子域名到服务端端口的映射
|
||||
* @param subdomain
|
||||
*/
|
||||
public static void removeSubdomainToServerPort(String subdomain) {
|
||||
subdomainToServerPort.remove(subdomain);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据子域名获取外网端口
|
||||
* @param subdomain
|
||||
* @return
|
||||
*/
|
||||
public static Integer getServerPortBySubdomain(String subdomain) {
|
||||
return subdomainToServerPort.get(subdomain);
|
||||
}
|
||||
}
|
||||
@@ -20,6 +20,8 @@ neutrino:
|
||||
key-store-password: 123456
|
||||
key-manager-password: 123456
|
||||
jks-path: classpath:/test.jks
|
||||
# 如果不配置,则不支持代理http
|
||||
domain-name:
|
||||
data:
|
||||
db:
|
||||
type: sqlite
|
||||
@@ -40,10 +42,10 @@ solon.staticfiles.mappings:
|
||||
|
||||
mybatis.db:
|
||||
typeAliases: #支持包名 或 类名(大写开头 或 *)//支持 ** 或 * 占位符
|
||||
- "fun.asgc.neutrino.proxy.server.dal.entity"
|
||||
- "org.dromara.neutrinoproxy.server.dal.entity"
|
||||
mappers: #支持包名 或 类名(大写开头 或 *)或 xml(.xml结尾)//支持 ** 或 * 占位符
|
||||
- "classpath:mapper/*.xml"
|
||||
- "fun.asgc.neutrino.proxy.server.dal"
|
||||
- "org.dromara.neutrinoproxy.server.dal"
|
||||
configuration: #扩展配置(要与 MybatisConfiguration 类的属性一一对应)
|
||||
cacheEnabled: false
|
||||
mapUnderscoreToCamelCase: true
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="fun.asgc.neutrino.proxy.server.dal.PortGroupMapper">
|
||||
<mapper namespace="org.dromara.neutrinoproxy.server.dal.PortGroupMapper">
|
||||
|
||||
<select id="selectPortGroupListResList" resultType="fun.asgc.neutrino.proxy.server.controller.res.system.PortGroupListRes">
|
||||
<select id="selectPortGroupListResList" resultType="org.dromara.neutrinoproxy.server.controller.res.system.PortGroupListRes">
|
||||
SELECT g.*,
|
||||
CASE
|
||||
WHEN g.possessor_type = 1 THEN
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="fun.asgc.neutrino.proxy.server.dal.PortMappingMapper">
|
||||
<mapper namespace="org.dromara.neutrinoproxy.server.dal.PortMappingMapper">
|
||||
|
||||
<select id="selectPortMappingByCondition" resultType="fun.asgc.neutrino.proxy.server.dal.entity.PortMappingDO">
|
||||
<select id="selectPortMappingByCondition" resultType="org.dromara.neutrinoproxy.server.dal.entity.PortMappingDO">
|
||||
SELECT pm.* from port_mapping pm left join license on pm.license_id = license.`id`
|
||||
<where>
|
||||
<if test="req.userId != null">
|
||||
@@ -20,6 +20,9 @@
|
||||
<if test="req.enable != null">
|
||||
AND pm.enable = #{req.enable}
|
||||
</if>
|
||||
<if test="req.protocal != null and req.protocal != ''">
|
||||
AND pm.protocal = #{req.protocal}
|
||||
</if>
|
||||
</where>
|
||||
order by pm.id asc
|
||||
</select>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="fun.asgc.neutrino.proxy.server.dal.PortPoolMapper">
|
||||
<mapper namespace="org.dromara.neutrinoproxy.server.dal.PortPoolMapper">
|
||||
|
||||
<select id="selectResList" resultType="fun.asgc.neutrino.proxy.server.controller.res.system.PortPoolListRes">
|
||||
<select id="selectResList" resultType="org.dromara.neutrinoproxy.server.controller.res.system.PortPoolListRes">
|
||||
SELECT p.*,
|
||||
g.possessor_type,
|
||||
g.`name` group_name
|
||||
@@ -16,7 +16,7 @@
|
||||
ORDER BY p.id
|
||||
</select>
|
||||
|
||||
<select id="getAvailablePortList" resultType="fun.asgc.neutrino.proxy.server.controller.res.system.PortPoolListRes">
|
||||
<select id="getAvailablePortList" resultType="org.dromara.neutrinoproxy.server.controller.res.system.PortPoolListRes">
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="fun.asgc.neutrino.proxy.server.dal.ReportMapper">
|
||||
<mapper namespace="org.dromara.neutrinoproxy.server.dal.ReportMapper">
|
||||
|
||||
<select id="userFlowReportList" resultType="fun.asgc.neutrino.proxy.server.controller.res.report.UserFlowReportRes">
|
||||
<select id="userFlowReportList" resultType="org.dromara.neutrinoproxy.server.controller.res.report.UserFlowReportRes">
|
||||
SELECT
|
||||
u.id AS 'userId',
|
||||
u.name AS 'userName',
|
||||
@@ -30,7 +30,7 @@
|
||||
GROUP BY u.id
|
||||
</select>
|
||||
|
||||
<select id="licenseFLowReportList" resultType="fun.asgc.neutrino.proxy.server.controller.res.report.LicenseFlowReportRes">
|
||||
<select id="licenseFLowReportList" resultType="org.dromara.neutrinoproxy.server.controller.res.report.LicenseFlowReportRes">
|
||||
SELECT
|
||||
l.id AS 'licenseId',
|
||||
l.name AS 'licenseName',
|
||||
@@ -61,7 +61,7 @@
|
||||
GROUP BY l.id
|
||||
</select>
|
||||
|
||||
<select id="userFlowMonthReportList" resultType="fun.asgc.neutrino.proxy.server.controller.res.report.UserFlowMonthReportRes">
|
||||
<select id="userFlowMonthReportList" resultType="org.dromara.neutrinoproxy.server.controller.res.report.UserFlowMonthReportRes">
|
||||
SELECT
|
||||
T2.user_id,
|
||||
u.name AS 'userName',
|
||||
@@ -70,7 +70,6 @@
|
||||
T2.downFlowBytes
|
||||
FROM (
|
||||
|
||||
(
|
||||
SELECT
|
||||
frm.user_id,
|
||||
frm.date,
|
||||
@@ -78,16 +77,16 @@
|
||||
IFNULL(SUM(frm.read_bytes),0) AS 'downFlowBytes'
|
||||
FROM flow_report_month frm
|
||||
GROUP BY frm.user_id,frm.date
|
||||
)
|
||||
|
||||
UNION ALL
|
||||
(
|
||||
|
||||
SELECT
|
||||
T1.user_id,
|
||||
#{curMonthBeginDate} AS 'date',
|
||||
IFNULL(SUM(T1.upFlowBytes),0) AS 'upFlowBytes',
|
||||
IFNULL(SUM(T1.downFlowBytes),0) AS 'downFlowBytes'
|
||||
FROM (
|
||||
(
|
||||
|
||||
SELECT
|
||||
frd.user_id,
|
||||
frd.license_id,
|
||||
@@ -96,9 +95,9 @@
|
||||
frd.date
|
||||
FROM flow_report_day frd
|
||||
WHERE frd.date >= #{curMonthBeginDate} AND frd.date <= #{curDayBeginDate}
|
||||
)
|
||||
|
||||
UNION ALL
|
||||
(
|
||||
|
||||
SELECT
|
||||
frm.user_id,
|
||||
frm.license_id,
|
||||
@@ -108,10 +107,10 @@
|
||||
FROM flow_report_minute frm
|
||||
WHERE frm.date >= #{curDayBeginDate} AND frm.date <= #{curDate}
|
||||
GROUP BY frm.user_id,frm.license_id
|
||||
)
|
||||
|
||||
) T1
|
||||
GROUP BY T1.user_id
|
||||
)
|
||||
|
||||
) T2
|
||||
LEFT JOIN `user` u ON u.id = T2.user_id
|
||||
<where>
|
||||
@@ -122,7 +121,7 @@
|
||||
ORDER BY T2.user_id ASC,T2.date DESC
|
||||
</select>
|
||||
|
||||
<select id="licenseFLowMonthReportList" resultType="fun.asgc.neutrino.proxy.server.controller.res.report.LicenseFlowMonthReportRes">
|
||||
<select id="licenseFLowMonthReportList" resultType="org.dromara.neutrinoproxy.server.controller.res.report.LicenseFlowMonthReportRes">
|
||||
SELECT
|
||||
T2.user_id,
|
||||
u.name AS 'userName',
|
||||
@@ -133,7 +132,6 @@
|
||||
T2.downFlowBytes
|
||||
FROM (
|
||||
|
||||
(
|
||||
SELECT
|
||||
frm.user_id,
|
||||
frm.license_id,
|
||||
@@ -142,9 +140,9 @@
|
||||
IFNULL(SUM(frm.read_bytes),0) AS 'downFlowBytes'
|
||||
FROM flow_report_month frm
|
||||
GROUP BY frm.user_id,frm.license_id,frm.date
|
||||
)
|
||||
|
||||
UNION ALL
|
||||
(
|
||||
|
||||
SELECT
|
||||
T1.user_id,
|
||||
T1.license_id,
|
||||
@@ -152,7 +150,7 @@
|
||||
IFNULL(SUM(T1.upFlowBytes),0) AS 'upFlowBytes',
|
||||
IFNULL(SUM(T1.downFlowBytes),0) AS 'downFlowBytes'
|
||||
FROM (
|
||||
(
|
||||
|
||||
SELECT
|
||||
frd.user_id,
|
||||
frd.license_id,
|
||||
@@ -161,9 +159,9 @@
|
||||
frd.date
|
||||
FROM flow_report_day frd
|
||||
WHERE frd.date >= #{curMonthBeginDate} AND frd.date <= #{curDayBeginDate}
|
||||
)
|
||||
|
||||
UNION ALL
|
||||
(
|
||||
|
||||
SELECT
|
||||
frm.user_id,
|
||||
frm.license_id,
|
||||
@@ -173,10 +171,10 @@
|
||||
FROM flow_report_minute frm
|
||||
WHERE frm.date >= #{curDayBeginDate} AND frm.date <= #{curDate}
|
||||
GROUP BY frm.user_id,frm.license_id
|
||||
)
|
||||
|
||||
) T1
|
||||
GROUP BY T1.user_id,T1.license_id
|
||||
)
|
||||
|
||||
) T2
|
||||
LEFT JOIN `user` u ON u.id = T2.user_id
|
||||
LEFT JOIN `license` l ON l.id = T2.license_id
|
||||
@@ -191,7 +189,7 @@
|
||||
ORDER BY T2.user_id ASC,T2.license_id,T2.date DESC
|
||||
</select>
|
||||
|
||||
<select id="homeTodayFlow" resultType="fun.asgc.neutrino.proxy.server.service.bo.FlowBO">
|
||||
<select id="homeTodayFlow" resultType="org.dromara.neutrinoproxy.server.service.bo.FlowBO">
|
||||
SELECT
|
||||
IFNULL(SUM(frm.write_bytes),0) AS 'upFlowBytes',
|
||||
IFNULL(SUM(frm.read_bytes),0) AS 'downFlowBytes'
|
||||
@@ -199,37 +197,40 @@
|
||||
WHERE frm.date >= #{curDayBeginDate} AND frm.date <= #{curDate}
|
||||
</select>
|
||||
|
||||
<select id="homeTotalFlow" resultType="fun.asgc.neutrino.proxy.server.service.bo.FlowBO">
|
||||
<select id="homeTotalFlow" resultType="org.dromara.neutrinoproxy.server.service.bo.FlowBO">
|
||||
SELECT
|
||||
IFNULL(SUM(T.upFlowBytes),0) AS 'upFlowBytes',
|
||||
IFNULL(SUM(T.downFlowBytes),0) AS 'downFlowBytes'
|
||||
FROM (
|
||||
(
|
||||
|
||||
SELECT
|
||||
IFNULL(SUM(frm.write_bytes),0) AS 'upFlowBytes',
|
||||
IFNULL(SUM(frm.read_bytes),0) AS 'downFlowBytes'
|
||||
FROM flow_report_month frm
|
||||
) UNION ALL (
|
||||
UNION ALL
|
||||
|
||||
SELECT
|
||||
IFNULL(SUM(frd.write_bytes),0) AS 'upFlowBytes',
|
||||
IFNULL(SUM(frd.read_bytes),0) AS 'downFlowBytes'
|
||||
FROM flow_report_day frd
|
||||
WHERE frd.date >= #{curMonthBeginDate} AND frd.date <= #{curDayBeginDate}
|
||||
) UNION ALL (
|
||||
|
||||
UNION ALL
|
||||
|
||||
SELECT
|
||||
IFNULL(SUM(frm.write_bytes),0) AS 'upFlowBytes',
|
||||
IFNULL(SUM(frm.read_bytes),0) AS 'downFlowBytes'
|
||||
FROM flow_report_minute frm
|
||||
WHERE frm.date >= #{curDayBeginDate} AND frm.date <= #{curDate}
|
||||
)
|
||||
|
||||
) T
|
||||
</select>
|
||||
|
||||
<select id="homeLast7dFlowList" resultType="fun.asgc.neutrino.proxy.server.service.bo.SingleDayFlowBO">
|
||||
<select id="homeLast7dFlowList" resultType="org.dromara.neutrinoproxy.server.service.bo.SingleDayFlowBO">
|
||||
SELECT
|
||||
T.*
|
||||
FROM (
|
||||
(
|
||||
|
||||
SELECT
|
||||
frd.date,
|
||||
IFNULL(SUM(frd.write_bytes),0) AS 'upFlowBytes',
|
||||
@@ -237,14 +238,16 @@
|
||||
FROM flow_report_day frd
|
||||
WHERE frd.date >= #{beginDate} AND frd.date <= #{curDayBeginDate}
|
||||
GROUP BY frd.date
|
||||
) UNION ALL (
|
||||
|
||||
UNION ALL
|
||||
|
||||
SELECT
|
||||
#{curDayBeginDate} AS 'date',
|
||||
IFNULL(SUM(frm.write_bytes),0) AS 'upFlowBytes',
|
||||
IFNULL(SUM(frm.read_bytes),0) AS 'downFlowBytes'
|
||||
FROM flow_report_minute frm
|
||||
WHERE frm.date >= #{curDayBeginDate} AND frm.date <= #{curDate}
|
||||
)
|
||||
|
||||
) T
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -69,6 +69,8 @@ CREATE TABLE IF NOT EXISTS `license` (
|
||||
CREATE TABLE IF NOT EXISTS `port_mapping` (
|
||||
`id` int NOT NULL AUTO_INCREMENT COMMENT '主键ID',
|
||||
`license_id` int NOT NULL COMMENT 'licenseID',
|
||||
`protocal` varchar(10) NOT NULL DEFAULT 'TCP' COMMENT '协议',
|
||||
`subdomain` varchar(50) DEFAULT NULL COMMENT '子域名(仅HTTP时有效)',
|
||||
`server_port` int NOT NULL COMMENT '服务端端口',
|
||||
`client_ip` varchar(20) NOT NULL COMMENT '客户端IP',
|
||||
`client_port` int NOT NULL COMMENT '客户端端口',
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#port_mapping
|
||||
INSERT INTO port_mapping(`id`, `license_id`, `server_port`, `client_ip`, `client_port`, `is_online`, `enable`, `create_time`, `update_time`) VALUES
|
||||
(1, 1, 9101, '127.0.0.1', 8080, 2, 1, now(), now());
|
||||
INSERT INTO port_mapping(`id`, `license_id`, `server_port`, `client_ip`, `client_port`, `is_online`, `enable`, `create_time`, `update_time`) VALUES
|
||||
(2, 1, 9102, '127.0.0.1', 3306, 2, 1, now(), now());
|
||||
INSERT INTO port_mapping(`id`, `license_id`, `server_port`, `protocal`, `subdomain`, `client_ip`, `client_port`, `is_online`, `enable`, `create_time`, `update_time`) VALUES
|
||||
(1, 1, 9101, 'HTTP', 'test1', '127.0.0.1', 8080, 2, 1, now(), now());
|
||||
INSERT INTO port_mapping(`id`, `license_id`, `server_port`, `protocal`, `subdomain`, `client_ip`, `client_port`, `is_online`, `enable`, `create_time`, `update_time`) VALUES
|
||||
(2, 1, 9102, 'TCP', '', '127.0.0.1', 3306, 2, 1, now(), now());
|
||||
INSERT INTO port_mapping(`id`, `license_id`, `server_port`, `protocal`, `subdomain`, `client_ip`, `client_port`, `is_online`, `enable`, `create_time`, `update_time`) VALUES
|
||||
(3, 1, 9103, 'HTTP', 'test2', '127.0.0.1', 8081, 2, 1, now(), now());
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
ALTER TABLE port_mapping ADD `protocal` varchar(10) NOT NULL DEFAULT 'TCP' COMMENT '协议';
|
||||
ALTER TABLE port_mapping ADD `subdomain` varchar(50) DEFAULT NULL COMMENT '子域名(仅HTTP时有效)';
|
||||
@@ -63,6 +63,8 @@ CREATE UNIQUE INDEX IF NOT EXISTS I_license_key ON `license` (`key` ASC);
|
||||
CREATE TABLE IF NOT EXISTS `port_mapping` (
|
||||
`id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||
`license_id` INTEGER(20) NOT NULL,
|
||||
`protocal` VARCHAR(10) NOT NULL DEFAULT 'TCP',
|
||||
`subdomain` VARCHAR(50) DEFAULT NULL,
|
||||
`server_port` INTEGER NOT NULL,
|
||||
`client_ip` VARCHAR(20) NOT NULL,
|
||||
`client_port` INTEGER NOT NULL,
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#port_mapping
|
||||
INSERT INTO port_mapping(`id`, `license_id`, `server_port`, `client_ip`, `client_port`, `is_online`, `enable`, `create_time`, `update_time`) VALUES
|
||||
(1, 1, 9101, '127.0.0.1', 8080, 2, 1, STRFTIME('%s000', 'NOW'), STRFTIME('%s000', 'NOW'));
|
||||
INSERT INTO port_mapping(`id`, `license_id`, `server_port`, `client_ip`, `client_port`, `is_online`, `enable`, `create_time`, `update_time`) VALUES
|
||||
(2, 1, 9102, '127.0.0.1', 3306, 2, 1, STRFTIME('%s000', 'NOW'), STRFTIME('%s000', 'NOW'));
|
||||
INSERT INTO port_mapping(`id`, `license_id`, `server_port`, `protocal`, `subdomain`, `client_ip`, `client_port`, `is_online`, `enable`, `create_time`, `update_time`) VALUES
|
||||
(1, 1, 9101, 'HTTP', 'test1', '127.0.0.1', 8080, 2, 1, STRFTIME('%s000', 'NOW'), STRFTIME('%s000', 'NOW'));
|
||||
INSERT INTO port_mapping(`id`, `license_id`, `server_port`, `protocal`, `subdomain`, `client_ip`, `client_port`, `is_online`, `enable`, `create_time`, `update_time`) VALUES
|
||||
(2, 1, 9102, 'TCP', '', '127.0.0.1', 3306, 2, 1, STRFTIME('%s000', 'NOW'), STRFTIME('%s000', 'NOW'));
|
||||
INSERT INTO port_mapping(`id`, `license_id`, `server_port`, `protocal`, `subdomain`, `client_ip`, `client_port`, `is_online`, `enable`, `create_time`, `update_time`) VALUES
|
||||
(3, 1, 9103, 'HTTP', 'test2', '127.0.0.1', 8081, 2, 1, STRFTIME('%s000', 'NOW'), STRFTIME('%s000', 'NOW'));
|
||||
@@ -0,0 +1,2 @@
|
||||
ALTER TABLE port_mapping ADD `protocal` varchar(10) NOT NULL DEFAULT 'TCP';
|
||||
ALTER TABLE port_mapping ADD `subdomain` varchar(50) DEFAULT NULL;
|
||||
@@ -0,0 +1 @@
|
||||
neutrino-proxy.dromara.org
|
||||
@@ -8,12 +8,13 @@ module.exports = {
|
||||
// theme: require.resolve('../../vdoing'), // 使用本地主题 (先将vdoing主题文件下载到本地:https://github.com/xugaoyi/vuepress-theme-vdoing)
|
||||
|
||||
title: "中微子代理",
|
||||
description: '一个基于 netty 的、开源的 java 内网穿透项目',
|
||||
base: '/neutrino-proxy-vuepress/', // 默认'/'。如果你想将你的网站部署到如 https://foo.github.io/bar/,那么 base 应该被设置成 "/bar/",(否则页面将失去样式等文件)
|
||||
description: '一个基于Netty的开源内网穿透神器',
|
||||
base: '/neutrino-proxy/', // 默认'/'。如果你想将你的网站部署到如 https://foo.github.io/bar/,那么 base 应该被设置成 "/bar/",(否则页面将失去样式等文件)
|
||||
head: [ // 注入到页面<head> 中的标签,格式[tagName, { attrName: attrValue }, innerHTML?]
|
||||
['link', {rel: 'icon', href: '/img/favicon.ico'}], //favicons,资源放在public文件夹
|
||||
['meta', {name: 'keywords', content: 'vuepress,theme,blog,vdoing'}],
|
||||
['meta', {name: 'theme-color', content: '#11a8cd'}], // 移动浏览器主题颜色
|
||||
['meta', {name: 'referrer', content: 'no-referrer-when-downgrade'}], //统计在 Chrome 85 版本中,为了保护用户的隐私,默认的 Referrer Policy 则变成了 strict-origin-when-cross-origin
|
||||
|
||||
// ['meta', { name: 'wwads-cn-verify', content: '6c4b761a28b734fe93831e3fb400ce87' }], // 广告相关,你可以去掉
|
||||
// ['script', { src: 'https://cdn.wwads.cn/js/makemoney.js', type: 'text/javascript' }], // 广告相关,你可以去掉
|
||||
@@ -21,89 +22,21 @@ module.exports = {
|
||||
|
||||
// 主题配置
|
||||
themeConfig: {
|
||||
// nav: [
|
||||
// { text: '首页', link: '/' },
|
||||
// {
|
||||
// text: '指南', link: '/pages/a2f161/', items: [
|
||||
// { text: '主题初衷与诞生', link: '/pages/52d5c3/' },
|
||||
// { text: '介绍', link: '/pages/a2f161/' },
|
||||
// { text: '快速上手', link: '/pages/793dcb/' },
|
||||
// { text: '目录结构', link: '/pages/2f674a/' },
|
||||
// { text: '核心配置和约定', link: '/pages/33d574/' },
|
||||
// { text: '自动生成front matter', link: '/pages/088c16/' },
|
||||
// { text: 'Markdown 容器', link: '/pages/d0d7eb/' },
|
||||
// { text: 'Markdown 中使用组件', link: '/pages/197691/' },
|
||||
// {
|
||||
// text: '相关文章', items: [
|
||||
// { text: '使目录栏支持h2~h6标题', link: '/pages/8dfab5/' },
|
||||
// { text: '如何让你的笔记更有表现力', link: '/pages/dd027d/' },
|
||||
// { text: '批量操作front matter工具', link: '/pages/2b8e22/' },
|
||||
// { text: '部署', link: '/pages/0fc1d2/' },
|
||||
// { text: '关于写文章和H1标题', link: '/pages/9ae0bd/' },
|
||||
// { text: '关于博客搭建与管理', link: '/pages/26997d/' },
|
||||
// { text: '在线编辑和新增文章的方法', link: '/pages/c5a54d/' },
|
||||
// ]
|
||||
// }
|
||||
// ]
|
||||
// },
|
||||
// {
|
||||
// text: '配置', link: '/pages/a20ce8/', items: [
|
||||
// { text: '主题配置', link: '/pages/a20ce8/' },
|
||||
// { text: '首页配置', link: '/pages/f14bdb/' },
|
||||
// { text: 'front matter配置', link: '/pages/3216b0/' },
|
||||
// { text: '目录页配置', link: '/pages/54651a/' },
|
||||
// { text: '添加摘要', link: '/pages/1cc523/' },
|
||||
// { text: '修改主题颜色和样式', link: '/pages/f51918/' },
|
||||
// { text: '评论栏', link: '/pages/ce175c/' },
|
||||
// ]
|
||||
// },
|
||||
// { text: '资源', link: '/pages/db78e2/' },
|
||||
// { text: '案例', link: '/pages/5d571c/' },
|
||||
// { text: '问答', link: '/pages/9cc27d/' },
|
||||
// { text: '赞助', link: '/pages/1b12ed/' },
|
||||
// ],
|
||||
nav: [
|
||||
{text: '首页', link: '/'},
|
||||
{
|
||||
text: '快速使用', link: '/pages/793dcb/', items: [
|
||||
text: '文档', link: '/pages/793dcb/', items: [
|
||||
{text: '快速上手', link: '/pages/793dcb/'},
|
||||
{text: '目录结构', link: '/pages/2f674a/'},
|
||||
{text: 'Markdown 容器', link: '/pages/d0d7eb/'},
|
||||
{text: 'Markdown 中使用组件', link: '/pages/197691/'},
|
||||
{
|
||||
text: '相关文章', items: [
|
||||
{text: '使目录栏支持h2~h6标题', link: '/pages/8dfab5/'},
|
||||
{text: '如何让你的笔记更有表现力', link: '/pages/dd027d/'},
|
||||
{text: '批量操作front matter工具', link: '/pages/2b8e22/'},
|
||||
{text: '部署', link: '/pages/0fc1d2/'},
|
||||
{text: '关于写文章和H1标题', link: '/pages/9ae0bd/'},
|
||||
{text: '关于博客搭建与管理', link: '/pages/26997d/'},
|
||||
{text: '在线编辑和新增文章的方法', link: '/pages/c5a54d/'},
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
text: '常见问题', link: '/pages/a20ce8/', items: [
|
||||
{text: '主题配置', link: '/pages/a20ce8/'},
|
||||
{text: '首页配置', link: '/pages/f14bdb/'},
|
||||
{text: 'front matter配置', link: '/pages/3216b0/'},
|
||||
{text: '目录页配置', link: '/pages/54651a/'},
|
||||
{text: '添加摘要', link: '/pages/1cc523/'},
|
||||
{text: '修改主题颜色和样式', link: '/pages/f51918/'},
|
||||
{text: '评论栏', link: '/pages/ce175c/'},
|
||||
{text: '后台操作指南', link: '/pages/793dcc/'},
|
||||
]
|
||||
},
|
||||
{text: '演示', link: '/pages/db78e2/'},
|
||||
{text: '案例', link: '/pages/5d571c/'},
|
||||
{text: '最近更新', link: '/pages/9cc27d/'},
|
||||
{text: '关于我们', link: '/pages/1b12ed/'},
|
||||
{text: 'Gitee', link: 'https://gitee.com/dromara/neutrino-proxy'},
|
||||
],
|
||||
sidebarDepth: 2, // 侧边栏显示深度,默认1,最大2(显示到h3标题)
|
||||
logo: '/img/logo.png', // 导航栏logo
|
||||
// repo: 'aoshiguchen/neutrino-proxy', // 导航栏右侧生成Github链接
|
||||
repo: 'https://gitee.com/dromara/neutrino-proxy', // 导航栏右侧生成Github链接
|
||||
repoLabel: 'Gitee地址',
|
||||
repo: 'https://github.com/dromara/neutrino-proxy', // 导航栏右侧生成Github链接
|
||||
repoLabel: 'Github',
|
||||
searchMaxSuggestions: 10, // 搜索结果显示最大数
|
||||
lastUpdated: '上次更新', // 更新的时间,及前缀文字 string | boolean (取值为git提交时间)
|
||||
|
||||
@@ -194,7 +127,7 @@ module.exports = {
|
||||
[
|
||||
'vuepress-plugin-baidu-tongji', // 百度统计
|
||||
{
|
||||
hm: baiduCode || '01293bffa6c3962016c08ba685c79d78'
|
||||
hm: baiduCode || 'f5901e55fecee5322d9f613841c717b8'
|
||||
}
|
||||
],
|
||||
|
||||
|
||||
|
After Width: | Height: | Size: 440 KiB |
|
After Width: | Height: | Size: 502 KiB |
|
After Width: | Height: | Size: 441 KiB |
|
After Width: | Height: | Size: 435 KiB |
|
After Width: | Height: | Size: 449 KiB |
|
After Width: | Height: | Size: 394 KiB |
|
Before Width: | Height: | Size: 276 KiB After Width: | Height: | Size: 327 KiB |
|
After Width: | Height: | Size: 427 KiB |
|
After Width: | Height: | Size: 312 KiB |
|
Before Width: | Height: | Size: 216 KiB After Width: | Height: | Size: 354 KiB |
|
Before Width: | Height: | Size: 425 KiB After Width: | Height: | Size: 495 KiB |
|
After Width: | Height: | Size: 328 KiB |
|
After Width: | Height: | Size: 315 KiB |
|
Before Width: | Height: | Size: 202 KiB After Width: | Height: | Size: 311 KiB |
@@ -1,24 +1,25 @@
|
||||
// .home-wrapper .banner .banner-conent .hero h1{
|
||||
// font-size 2.8rem!important
|
||||
// }
|
||||
// // 文档中适配
|
||||
// table
|
||||
// width auto
|
||||
// .page >*:not(.footer),.card-box
|
||||
// box-shadow: none!important
|
||||
.home-wrapper .banner .banner-conent .hero h1{
|
||||
font-size 2.8rem!important
|
||||
}
|
||||
|
||||
// .page
|
||||
// @media (min-width $contentWidth + 80)
|
||||
// padding-top $navbarHeight!important
|
||||
// .home-wrapper .banner .banner-conent
|
||||
// padding 0 2.9rem
|
||||
// box-sizing border-box
|
||||
// .home-wrapper .banner .slide-banner .slide-banner-wrapper .slide-item a
|
||||
// h2
|
||||
// margin-top 2rem
|
||||
// font-size 1.2rem!important
|
||||
// p
|
||||
// padding 0 1rem
|
||||
// 文档中适配
|
||||
table
|
||||
width auto
|
||||
.page >*:not(.footer),.card-box
|
||||
box-shadow: none!important
|
||||
|
||||
.page
|
||||
@media (min-width $contentWidth + 80)
|
||||
padding-top $navbarHeight!important
|
||||
.home-wrapper .banner .banner-conent
|
||||
padding 0 2.9rem
|
||||
box-sizing border-box
|
||||
.home-wrapper .banner .slide-banner .slide-banner-wrapper .slide-item a
|
||||
h2
|
||||
margin-top 2rem
|
||||
font-size 1.2rem!important
|
||||
p
|
||||
padding 0 1rem
|
||||
|
||||
// 评论区颜色重置
|
||||
.gt-container
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
// .home-wrapper .banner .banner-conent .hero h1{
|
||||
// font-size 2.8rem!important
|
||||
// }
|
||||
// // 文档中适配
|
||||
// table
|
||||
// width auto
|
||||
// .page >*:not(.footer),.card-box
|
||||
// box-shadow: none!important
|
||||
|
||||
// .page
|
||||
// @media (min-width $contentWidth + 80)
|
||||
// padding-top $navbarHeight!important
|
||||
// .home-wrapper .banner .banner-conent
|
||||
// padding 0 2.9rem
|
||||
// box-sizing border-box
|
||||
// .home-wrapper .banner .slide-banner .slide-banner-wrapper .slide-item a
|
||||
// h2
|
||||
// margin-top 2rem
|
||||
// font-size 1.2rem!important
|
||||
// p
|
||||
// padding 0 1rem
|
||||
|
||||
// 评论区颜色重置
|
||||
.gt-container
|
||||
.gt-ico-tip
|
||||
&::after
|
||||
content: '。( Win + . ) or ( ⌃ + ⌘ + ␣ ) open Emoji'
|
||||
color: #999
|
||||
.gt-meta
|
||||
border-color var(--borderColor)!important
|
||||
.gt-comments-null
|
||||
color var(--textColor)
|
||||
opacity .5
|
||||
.gt-header-textarea
|
||||
color var(--textColor)
|
||||
background rgba(180,180,180,0.1)!important
|
||||
.gt-btn
|
||||
border-color $accentColor!important
|
||||
background-color $accentColor!important
|
||||
.gt-btn-preview
|
||||
background-color rgba(255,255,255,0)!important
|
||||
color $accentColor!important
|
||||
a
|
||||
color $accentColor!important
|
||||
.gt-svg svg
|
||||
fill $accentColor!important
|
||||
.gt-comment-content,.gt-comment-admin .gt-comment-content
|
||||
background-color rgba(150,150,150,0.1)!important
|
||||
&:hover
|
||||
box-shadow 0 0 25px rgba(150,150,150,.5)!important
|
||||
.gt-comment-body
|
||||
color var(--textColor)!important
|
||||
|
||||
|
||||
// qq徽章
|
||||
.qq
|
||||
position: relative;
|
||||
.qq::after
|
||||
content: "可撩";
|
||||
background: $accentColor;
|
||||
color:#fff;
|
||||
padding: 0 5px;
|
||||
border-radius: 10px;
|
||||
font-size:12px;
|
||||
position: absolute;
|
||||
top: -4px;
|
||||
right: -35px;
|
||||
transform:scale(0.85);
|
||||
|
||||
// demo模块图标颜色
|
||||
body .vuepress-plugin-demo-block__wrapper
|
||||
&,.vuepress-plugin-demo-block__display
|
||||
border-color rgba(160,160,160,.3)
|
||||
.vuepress-plugin-demo-block__footer:hover
|
||||
.vuepress-plugin-demo-block__expand::before
|
||||
border-top-color: $accentColor !important;
|
||||
border-bottom-color: $accentColor !important;
|
||||
svg
|
||||
fill: $accentColor !important;
|
||||
|
||||
|
||||
// 全文搜索框
|
||||
.suggestions
|
||||
overflow: auto
|
||||
max-height: calc(100vh - 6rem)
|
||||
@media (max-width: 719px) {
|
||||
width: 90vw;
|
||||
min-width: 90vw!important;
|
||||
margin-right: -20px;
|
||||
}
|
||||
.highlight
|
||||
color: $accentColor
|
||||
font-weight: bold
|
||||
@@ -4,9 +4,9 @@
|
||||
//***vdoing主题-变量***//
|
||||
|
||||
// // 颜色
|
||||
|
||||
$nprogressColor = #4274F4
|
||||
// $bannerTextColor = #fff // 首页banner区(博客标题)文本颜色
|
||||
// $accentColor = #11A8CD
|
||||
$accentColor = #4274F4
|
||||
// $arrowBgColor = #ccc
|
||||
// $badgeTipColor = #42b983
|
||||
// $badgeWarningColor = darken(#ffe564, 35%)
|
||||
@@ -23,40 +23,40 @@
|
||||
// $lineNumbersWrapperWidth = 2.5rem
|
||||
|
||||
// 浅色模式
|
||||
// .theme-mode-light
|
||||
// --bodyBg: rgba(255,255,255,1)
|
||||
// --mainBg: rgba(255,255,255,1)
|
||||
// --sidebarBg: rgba(255,255,255,.8)
|
||||
// --blurBg: rgba(255,255,255,.9)
|
||||
// // --textColor: #004050
|
||||
// --textLightenColor: #0085AD
|
||||
// --borderColor: rgba(0,0,0,.15)
|
||||
// --codeBg: #f6f6f6
|
||||
// --codeColor: #525252
|
||||
// codeThemeLight()
|
||||
.theme-mode-light
|
||||
--bodyBg: #f4f4f4
|
||||
--mainBg: #fff
|
||||
--sidebarBg: #fff
|
||||
--blurBg: #fff
|
||||
// --textColor: #004050
|
||||
--textLightenColor: #4274F4
|
||||
--borderColor: rgba(0,0,0,.15)
|
||||
--codeBg: #282C34
|
||||
--codeColor: #fff
|
||||
codeThemeDark()
|
||||
|
||||
// // 深色模式
|
||||
// .theme-mode-dark
|
||||
// --bodyBg: rgba(30,30,34,1)
|
||||
// --mainBg: rgba(30,30,34,1)
|
||||
// --sidebarBg: rgba(30,30,34,.8)
|
||||
// --blurBg: rgba(30,30,34,.8)
|
||||
// --textColor: rgb(140,140,150)
|
||||
// --textLightenColor: #0085AD
|
||||
// --borderColor: #2C2C3A
|
||||
// --codeBg: #252526
|
||||
// --codeColor: #fff
|
||||
// codeThemeDark()
|
||||
// 深色模式
|
||||
.theme-mode-dark
|
||||
--bodyBg: #22272E
|
||||
--mainBg: #22272E
|
||||
--sidebarBg: #22272E
|
||||
--blurBg: #22272E
|
||||
--textColor: #ADBAC7
|
||||
--textLightenColor: #4274F4
|
||||
--borderColor: #2C2C3A
|
||||
--codeBg: #282C34
|
||||
--codeColor: #fff
|
||||
codeThemeDark()
|
||||
|
||||
// // 阅读模式
|
||||
// .theme-mode-read
|
||||
// --bodyBg: rgba(245,245,213,1)
|
||||
// --mainBg: rgba(245,245,213,1)
|
||||
// --sidebarBg: rgba(245,245,213,.8)
|
||||
// --blurBg: rgba(245,245,213,.9)
|
||||
// --textColor: #004050
|
||||
// --textLightenColor: #0085AD
|
||||
// --borderColor: rgba(0,0,0,.15)
|
||||
// --codeBg: #282c34
|
||||
// --codeColor: #fff
|
||||
// codeThemeDark()
|
||||
// 阅读模式
|
||||
.theme-mode-read
|
||||
--bodyBg: rgba(245,245,213,1)
|
||||
--mainBg: rgba(245,245,213,1)
|
||||
--sidebarBg: rgba(245,245,213,.8)
|
||||
--blurBg: rgba(245,245,213,.9)
|
||||
--textColor: #004050
|
||||
--textLightenColor: #4274F4
|
||||
--borderColor: rgba(0,0,0,.15)
|
||||
--codeBg: #282C34
|
||||
--codeColor: #fff
|
||||
codeThemeDark()
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
|
||||
// 原主题变量已弃用,以下是vdoing使用的变量,你可以在这个文件内修改它们。
|
||||
|
||||
//***vdoing主题-变量***//
|
||||
|
||||
// // 颜色
|
||||
|
||||
// $bannerTextColor = #fff // 首页banner区(博客标题)文本颜色
|
||||
// $accentColor = #11A8CD
|
||||
// $arrowBgColor = #ccc
|
||||
// $badgeTipColor = #42b983
|
||||
// $badgeWarningColor = darken(#ffe564, 35%)
|
||||
// $badgeErrorColor = #DA5961
|
||||
|
||||
// // 布局
|
||||
// $navbarHeight = 3.6rem
|
||||
// $sidebarWidth = 18rem
|
||||
// $contentWidth = 860px
|
||||
// $homePageWidth = 1100px
|
||||
// $rightMenuWidth = 230px // 右侧菜单
|
||||
|
||||
// // 代码块
|
||||
// $lineNumbersWrapperWidth = 2.5rem
|
||||
|
||||
// 浅色模式
|
||||
// .theme-mode-light
|
||||
// --bodyBg: rgba(255,255,255,1)
|
||||
// --mainBg: rgba(255,255,255,1)
|
||||
// --sidebarBg: rgba(255,255,255,.8)
|
||||
// --blurBg: rgba(255,255,255,.9)
|
||||
// // --textColor: #004050
|
||||
// --textLightenColor: #0085AD
|
||||
// --borderColor: rgba(0,0,0,.15)
|
||||
// --codeBg: #f6f6f6
|
||||
// --codeColor: #525252
|
||||
// codeThemeLight()
|
||||
|
||||
// // 深色模式
|
||||
// .theme-mode-dark
|
||||
// --bodyBg: rgba(30,30,34,1)
|
||||
// --mainBg: rgba(30,30,34,1)
|
||||
// --sidebarBg: rgba(30,30,34,.8)
|
||||
// --blurBg: rgba(30,30,34,.8)
|
||||
// --textColor: rgb(140,140,150)
|
||||
// --textLightenColor: #0085AD
|
||||
// --borderColor: #2C2C3A
|
||||
// --codeBg: #252526
|
||||
// --codeColor: #fff
|
||||
// codeThemeDark()
|
||||
|
||||
// // 阅读模式
|
||||
// .theme-mode-read
|
||||
// --bodyBg: rgba(245,245,213,1)
|
||||
// --mainBg: rgba(245,245,213,1)
|
||||
// --sidebarBg: rgba(245,245,213,.8)
|
||||
// --blurBg: rgba(245,245,213,.9)
|
||||
// --textColor: #004050
|
||||
// --textLightenColor: #0085AD
|
||||
// --borderColor: rgba(0,0,0,.15)
|
||||
// --codeBg: #282c34
|
||||
// --codeColor: #fff
|
||||
// codeThemeDark()
|
||||
@@ -0,0 +1,117 @@
|
||||
---
|
||||
title: 快速上手
|
||||
date: 2023-03-28 20:30:00
|
||||
permalink: /pages/793dcb
|
||||
article: false
|
||||
---
|
||||
|
||||
接下来您讲学习到如何快速上手
|
||||
## 1、 部署服务端
|
||||
### 1.1、 Docker一键部署
|
||||
#### 使用默认sqlite数据库
|
||||
```shell
|
||||
docker run -it -p 9000-9200:9000-9200/tcp -p 8888:8888 \
|
||||
-d --restart=always --name neutrino-proxy \
|
||||
registry.cn-hangzhou.aliyuncs.com/asgc/neutrino-proxy:1.7.1
|
||||
```
|
||||
|
||||
#### 指定自己的mysql数据库
|
||||
- 在服务器上创建目录:/root/neutrino-proxy/config
|
||||
- 在该目录下创建`app.yml`文本文件,并配置如下内容:
|
||||
```yml
|
||||
neutrino:
|
||||
data:
|
||||
db:
|
||||
type: mysql
|
||||
# 自己的数据库实例,创建一个空的名为'neutrino-proxy'的数据库即可,首次启动服务端会自动初始化
|
||||
url: jdbc:mysql://xxxx:3306/neutrino-proxy?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&useAffectedRows=true&useSSL=false
|
||||
driver-class: com.mysql.jdbc.Driver
|
||||
# 数据库帐号
|
||||
username: xxx
|
||||
# 数据库密码
|
||||
password: wHCvf3@hmw^D*
|
||||
```
|
||||
- 然后执行如下命令:
|
||||
```shell
|
||||
docker run -it -p 9000-9200:9000-9200/tcp -p 8888:8888 \
|
||||
-v /root/neutrino-proxy/config:/root/neutrino-proxy/config \
|
||||
-d --restart=always --name neutrino \
|
||||
registry.cn-hangzhou.aliyuncs.com/asgc/neutrino-proxy:1.7.1
|
||||
```
|
||||
|
||||
### 1.2、使用jar包自行部署
|
||||
- 首先确保服务器上已安装java8运行环境
|
||||
- 打开[发行版页面](https://gitee.com/dromara/neutrino-proxy/releases),下载最新的release包:`neutrino-proxy-server.jar`、`neutrino-proxy-admin.zip`
|
||||
- 在服务器上新建部署目录:`/work/projects/neutrino-proxy-server`
|
||||
- 将` neutrino-proxy-server.jar`、`neutrino-proxy-admin.zip`上传至服务器部署目录。
|
||||
- 解压`neutrino-proxy-admin.zip`文件
|
||||
- 执行命令`java -jar neutrino-proxy-server.jar`启动服务端完成部署,默认使用sqlite数据库。
|
||||
- 若需要指定自己的mysql数据库,同样的需要在当前目录下新建`app.yml`文件,文件内容同上。执行命令`java -jar neutrino-proxy-server.jar config=app.yml`启动服务端完成部署
|
||||
- 可参照 https://gitee.com/dromara/neutrino-proxy/blob/master/bin/server_start.sh 使用shell脚本启动服务端。
|
||||
|
||||
## 2、管理后台配置
|
||||
- 服务端部署成功后,访问`http://{服务端IP}:8888`打开后台管理页面。
|
||||
- 使用默认的管理员帐号登录:admin/123456
|
||||
- 打开`代理配置>License管理`页面,可以看到系统已经自动为管理员初始化了一条License记录,复制该`LicenseKey`备用,后续客户端配置需要。
|
||||
- 打开`代理配置>端口映射`页面,可以看到系统已经自动为初始化了几条端口映射。可根据需要自行添加、修改。这里我们以`9101 -> 127.0.0.1:8080`映射为例
|
||||
|
||||
## 3、启动客户端
|
||||
- 首先确保本地已安装java8运行环境
|
||||
- 打开[发行版页面](https://gitee.com/dromara/neutrino-proxy/releases),下载最新的release包:`neutrino-proxy-client.jar`
|
||||
- 在本地`neutrino-proxy-client.jar`同级别目录下新建`app.yml`文件,并配置如下内容:
|
||||
```yml
|
||||
neutrino:
|
||||
proxy:
|
||||
client:
|
||||
# ssl证书密钥(使用jjar包内自带的证书,则此处无需修改)
|
||||
key-store-password: 123456
|
||||
# ssl证书管理密钥(使用jjar包内自带的证书,则此处无需修改。自定义证书,则此处配置对应的路径)
|
||||
jks-path: classpath:/test.jks
|
||||
# 代理服务端IP
|
||||
server-ip: localhost
|
||||
# 代理服务端IP, 若是非ssl端口,则ssl-enable需要配置为false
|
||||
server-port: 9002
|
||||
# 是否启用ssl
|
||||
ssl-enable: true
|
||||
# licenseKey,客户端凭证。此处需要配置刚刚从管理后台复制的LicenseKey
|
||||
license-key: xxxx
|
||||
```
|
||||
- 执行命令`java -jar neutrino-proxy-client.jar`启动客户端
|
||||
- 查看服务端License管理,刷新页面,对应的License在线状态为`在线`,则表明客户端已正常连接。
|
||||
|
||||
## 4、代理验证
|
||||
- 本地启动被代理服务,如:redis、本地web项目、本地mysql等等
|
||||
- 先确保本地能正常访问被代理服务,如果本地都不能访问,不用想代理更不可能!!!
|
||||
- 通过服务端IP+9101(上面License配置的端口映射重的服务端端口)访问本地被代理服务
|
||||
|
||||
访问成功,至此首次完整的内网穿透体验完成。开源不易,请速至[Gitee仓库](https://gitee.com/dromara/neutrino-proxy)一键三连🤝
|
||||
|
||||
<!--
|
||||
## 4.开发&调试
|
||||
|
||||
::: tip
|
||||
1. 不建议在原默认vuepress项目上单独安装使用本主题包,而是clone我的整个项目再替换你自己的内容即可。
|
||||
2. 修改`config.js`配置后需要重新启动项目才会生效。
|
||||
3. 更多关于项目上手的问题,请查阅 [问答](/pages/9cc27d/)。
|
||||
:::
|
||||
|
||||
|
||||
## 版本升级
|
||||
|
||||
主题的版本会不定期更新,你只需更新npm主题包即可:
|
||||
```sh
|
||||
npm update vuepress-theme-vdoing
|
||||
```
|
||||
|
||||
::: tip
|
||||
1. 如更新后没起作用或报错,尝试把`node_modules`文件夹删除再`npm i`重新安装。
|
||||
2. 在.vuepress/config.js中,设置`theme: 'vdoing'`才是使用npm主题依赖包:
|
||||
```js
|
||||
// config.js
|
||||
module.exports = {
|
||||
theme: 'vdoing', // npm主题依赖包
|
||||
// theme: require.resolve('../../vdoing'), // 使用本地主题包
|
||||
}
|
||||
```
|
||||
:::
|
||||
-->
|
||||
@@ -0,0 +1,47 @@
|
||||
---
|
||||
title: 后台操作指南
|
||||
date: 2023-03-28 20:30:00
|
||||
permalink: /pages/793dcc
|
||||
article: false
|
||||
---
|
||||
|
||||
# 首页
|
||||
- License统计:统计License相关数量指标
|
||||
- 端口映射统计:统计端口映射相关数量指标
|
||||
- 今日流量:统计当天的服务端上行/下行流量数据
|
||||
- 流量汇总:统计所有(包含当天)的服务端上行/下行流量数据
|
||||
- 流量监控:按天统计最近15天(可能会动态调整)每天的上行流量、下行流量、汇总流量
|
||||
|
||||
<img :src="$withBase('/img/run-example/home.png')"></img>
|
||||
|
||||
# 代理配置
|
||||
- License管理:License是客户端连接服务端的唯一合法凭证。一个License同时只能被一个客户端使用,一个License可以维护多条端口映射
|
||||
- 端口映射:服务端IP+端口 -> 客户端IP+端口的四元组映射(因目前服务端单节点只有一个公网IP,所以不体现出来),是内网穿透的基本单元。
|
||||
|
||||
<img :src="$withBase('/img/run-example/license1.png')"></img>
|
||||
|
||||
# 系统管理
|
||||
- 用户管理:支持多用户,一个用户可持有多个License。由于项目目前主推个人版,所以暂是没有权限这一套,管理员之外的所有用户都属于游客。对于绝大多数操作,游客仅有只读权限。
|
||||
- 端口池管理:用于统一管理服务器内网穿透端口,方便统一设置安全组。
|
||||
- 端口池分组:对端口池的一个分组。
|
||||
- 全局分组:该分组下的端口全局通用。
|
||||
- 用户分组:该分组下的端口由分组绑定的用户独占。
|
||||
- License分组:该分组下的端口由分组绑定的License独占。
|
||||
- 调度管理:维护服务端定时任务。方便开发、调试。正常使用时无需关心。
|
||||
|
||||
<img :src="$withBase('/img/run-example/user-manager1.png')"></img>
|
||||
|
||||
# 报表管理
|
||||
- 用户流量报表:基于用户维度的流量统计
|
||||
- License流量报表:基于License的流量统计
|
||||
- 用户流量月度明细:基于用户的流量月度统计
|
||||
- License流量月度明细:基于License的流量月度统计
|
||||
|
||||
<img :src="$withBase('/img/run-example/user-flow1.png')"></img>
|
||||
|
||||
# 日志管理
|
||||
- 调度日志:服务端定时任务执行日志
|
||||
- 登录日志:管理后端登录、退出登录的日志
|
||||
- 客户端连接日志:客户端连接、断开的日志
|
||||
|
||||
<img :src="$withBase('/img/run-example/login-log1.png')"></img>
|
||||
@@ -1,150 +0,0 @@
|
||||
---
|
||||
title: 快速上手
|
||||
date: 2020-05-11 13:54:40
|
||||
permalink: /pages/793dcb
|
||||
article: false
|
||||
---
|
||||
|
||||
## 1. 打包
|
||||
可直接前往Gitee仓库发行版页面下载所需版本已打好的包。若需手动打包,则可参照下面的执行命令:
|
||||
```text
|
||||
# 服务端打包
|
||||
mvn clean install -U -pl neutrino-proxy-server -am -Dmaven.test.skip=true
|
||||
|
||||
# 客户端打包
|
||||
clean install -U -pl neutrino-proxy-client -am -Dmaven.test.skip=true
|
||||
|
||||
# 管理后台前端项目打包(本地环境,local改为dev则为dev环境,同时需要修改config目录下面的环境配置)
|
||||
npm run build:local
|
||||
```
|
||||
|
||||
## 2. 部署
|
||||
### 2.2 服务端部署
|
||||
- 使用常规的jar包部署方式即可,如:java -jar xxxx
|
||||
### 2.4 管理后台部署
|
||||
- Nginx方式部署(推荐):
|
||||
```conf
|
||||
server {
|
||||
listen 9527;
|
||||
server_name localhost;
|
||||
|
||||
#开启gzip
|
||||
gzip on;
|
||||
#低于1kb的资源不压缩
|
||||
gzip_min_length 1k;
|
||||
#压缩级别1-9,越大压缩率越高,同时消耗cpu资源也越多,建议设置在5左右。
|
||||
gzip_comp_level 5;
|
||||
#需要压缩哪些响应类型的资源,多个空格隔开。不建议压缩图片.
|
||||
gzip_types text/plain application/javascript application/x-javascript text/javascript text/xml text/css;
|
||||
#配置禁用gzip条件,支持正则。此处表示ie6及以下不启用gzip(因为ie低版本不支持)
|
||||
gzip_disable "MSIE [1-6]\.";
|
||||
#是否添加“Vary: Accept-Encoding”响应头
|
||||
gzip_vary on;
|
||||
|
||||
location / {
|
||||
root /work/projects/neutrino-proxy-server/neutrino-proxy-admin/dist;
|
||||
try_files $uri $uri/ /index.html;
|
||||
add_header Last-Modified $date_gmt;
|
||||
}
|
||||
}
|
||||
````
|
||||
- 无nginx时
|
||||
在没有Nginx时,为了快速体验代理效果,可直接使用服务端项目提供的静态资源服务。直接将neutrino-proxy-admin打包后的文件解压放在neutrino-proxy-server.jar同级别目录下即可。例如:服务端配置的web端口为8080,则访问http://服务端IP:8080, 则会直接解析渲染neutrino-proxy-server.jar同级别目录下neutrino-proxy-admin/dist/index.html。
|
||||
|
||||
::: warning
|
||||
需要注意的是,使用服务端自带的静态资源服务时,由于框架目前未支持缓存、gzip压缩,所以访问速度没有使用nginx快,正式使用推荐用nginx。
|
||||
:::
|
||||
|
||||
## 3.配置
|
||||
|
||||
### 3.1 配置端口池
|
||||
端口池的作用是将代理服务需要对外暴露的端口进行集中管理,方便安全组设置时统一操作。
|
||||
|
||||
本项目为了简化首次配置,默认初始化数据会将9101~9120的所有端口加入端口池。可以在服务端项目sql配置(port_pool.data.sql文件)中自行修改初始化数据,也可以运行后在端口池管理页面手动维护。
|
||||
|
||||
首次使用如果为了快速体验,建议直接使用默认端口池,则无需任何配置。
|
||||
|
||||
### 3.2 配置License
|
||||
License是客户端连接代理服务端时所需要的唯一合法凭证,一个License同时只能被一个客户端使用。
|
||||
|
||||
本项目为了简化首次配置,默认为每个用户初始化了一些license。可以在服务端项目sql配置(license.data.sql文件)中自行修改初始化数据,也可以运行后在License管理页面手动维护。
|
||||
|
||||
首次使用如果为了快速体验,建议直接使用默认License,则无需任何配置。
|
||||
|
||||
### 3.3 配置端口映射
|
||||
端口映射是代理的基本单元,一个外网端口在同一时刻被唯一的映射到一个内网IP+端口。所有流出该外网端口的流量都转发自对应的内网端口,同理所有流入该外网端口的流量都会转发到对应的内网端口。
|
||||
|
||||
本项目为了简化首次配置,默认为每个用户初始化了一些端口映射。可以在服务端项目sql配置(port_mapping.data.sql文件)中自行修改初始化数据,也可以运行后在端口映射管理页面手动维护。
|
||||
|
||||
首次使用如果为了快速体验,建议直接使用默认端口映射,则无需任何配置。
|
||||
|
||||
### 3.4 开启代理
|
||||
上述步骤完成后,就可以开始代理自己的局域网设备了。
|
||||
|
||||
比如现在有一个license:a123456,该license配置了一个或多个端口映射,其中包含9010到localhost:8080的映射(localhost表示代理客户端所在主机的端口,可以换成客户端所在局域网的任何IP)。此时修改客户端配置的服务端ip、license等启动客户端,就可以开启代理了,端口映射管理对应的记录在线状态为"在线"则证明代理成功建立。
|
||||
|
||||
该license配置也可以通过客户端启动参数、启动后引导式输入、外置配置提供,为了简化首次体验门槛,这里直接提供一个外置配置模版:
|
||||
```json
|
||||
{
|
||||
"jksPath":"classpath:/test.jks",
|
||||
"licenseKey":"b0a907332b474b25897c4dcb31fc7eb6",
|
||||
"serverIp":"localhost",
|
||||
"serverPort":9002,
|
||||
"sslEnable":true
|
||||
}
|
||||
```
|
||||
修改上述json中的licenseKey,serverIp、serverPort、sslEnabled后,保存文件命名为<font color="#9b6e23">.neutrino-proxy-client.json</font>,放在客户端当前目录下(jar包启动时,放在jar包同级别目录下。idea启动时,放在项目根目录下),然后直接启动客户端。
|
||||
|
||||
此时通过访问外网ip+端口,可以成功访问内网服务。通过此方式,可以代理任何基于TCP之上的协议,如:socket、websocket、http、ftp、ssh等。
|
||||
|
||||
## 4.开发&调试
|
||||
篇幅所限,此处不便赘述管理后台相关的开发,有vue基础的童鞋基本都可以自行开发。服务端的初始化数据足够调试工作,开发过程无需单独在管理页面操作。
|
||||
|
||||
与SpringBoot项目类似,客户端、服务端项目均由一个入口类完成整个项目的启动,分别为ProxyClient、ProxyServer。
|
||||
|
||||
内置配置采用yml风格,主要涉及Http端口、静态资源路径、协议参数、代理服务端端口、jks证书、数据源、license等。整个项目基于neutrino-core,风格类似于SpringBoot。笔者不喜欢因过分炫技而引入过多花式操作,因为项目的定位是个人开发者,且满足使用的同时兼顾学习其原理的需求。基本使用方式与SpringBoot类似,尽可能降低首次学习成本。
|
||||
|
||||
neutrino-core项目test目录下包含众多核心封装的测试代码,通过调试这些代码,能尽可能减少大家学习的障碍。
|
||||
|
||||
|
||||
## 5.运行截图
|
||||
### 用户管理
|
||||
<img :src="$withBase('/img/run-example/user-manager1.png')"></img>
|
||||
### 端口池管理
|
||||
<img :src="$withBase('/img/run-example/port-pool1.png')"></img>
|
||||
### License管理
|
||||
<img :src="$withBase('/img/run-example/license1.png')"></img>
|
||||
### 端口映射管理
|
||||
<img :src="$withBase('/img/run-example/port-mapping1.png')"></img>
|
||||
### 客户端启动示例
|
||||
<img :src="$withBase('/img/run-example/client-run1.png')"></img>
|
||||
|
||||
<!--
|
||||
## 4.开发&调试
|
||||
|
||||
::: tip
|
||||
1. 不建议在原默认vuepress项目上单独安装使用本主题包,而是clone我的整个项目再替换你自己的内容即可。
|
||||
2. 修改`config.js`配置后需要重新启动项目才会生效。
|
||||
3. 更多关于项目上手的问题,请查阅 [问答](/pages/9cc27d/)。
|
||||
:::
|
||||
|
||||
|
||||
## 版本升级
|
||||
|
||||
主题的版本会不定期更新,你只需更新npm主题包即可:
|
||||
```sh
|
||||
npm update vuepress-theme-vdoing
|
||||
```
|
||||
|
||||
::: tip
|
||||
1. 如更新后没起作用或报错,尝试把`node_modules`文件夹删除再`npm i`重新安装。
|
||||
2. 在.vuepress/config.js中,设置`theme: 'vdoing'`才是使用npm主题依赖包:
|
||||
```js
|
||||
// config.js
|
||||
module.exports = {
|
||||
theme: 'vdoing', // npm主题依赖包
|
||||
// theme: require.resolve('../../vdoing'), // 使用本地主题包
|
||||
}
|
||||
```
|
||||
:::
|
||||
-->
|
||||
@@ -1,68 +0,0 @@
|
||||
---
|
||||
title: 目录结构
|
||||
date: 2020-05-11 13:54:56
|
||||
permalink: /pages/2f674a
|
||||
article: false
|
||||
---
|
||||
|
||||
```
|
||||
├── data.db (sqlite数据库文件。若未配置mysql,默认使用sqlite,项目首次启动会自动初始化sqlite数据库。)
|
||||
├── docs (项目相关的一些文档)
|
||||
├── ├── Aop.MD (框架层Aop机制、使用说明)
|
||||
├── └── Channel.MD (内网穿透实现原理、代理实现流程说明)
|
||||
├── lib (项目开启了将自动生成的类保存到本地后,运行过程中动态生成的类自动保存到此处,方便学习、调试)
|
||||
├── neutrino-core (一套手写的基于netty的框架,相当于简易版的SpringBoot + Mybatis + xxljob,计划后期分离为单独开源项目维护)
|
||||
├── neutrino-proxy-admin (基于vue-element-admin开发的一个管理系统,用于可视化操作端口映射、代理数据实时监控)
|
||||
├── neutrino-proxy-client (基于netty的代理客户端,用于和服务端交互、转发内网数据)
|
||||
├── neutrino-proxy-core (代理相关的公共代码(协议、常量))
|
||||
├── neutrino-proxy-server (基于netty的代理服务端,用于和客户段交互,将客户端转发的内网数据转发至外网端口)
|
||||
└── todolist.MD (近期的开发计划)
|
||||
```
|
||||
|
||||
<!--
|
||||
* `docs` 文件夹名称请不要修改
|
||||
|
||||
* `docs/.vuepress` 用于存放全局的配置、样式、静态资源等,同官方,查看 [详情](https://vuepress.vuejs.org/zh/guide/directory-structure.html#目录结构)
|
||||
* `docs/@pages` 此文件夹是自动生成的,存放分类页、标签页、归档页对应的`.md`文件,一般不需要改动
|
||||
* `docs/_posts` 专门用于存放碎片化博客文章,里面的`.md`文件不需要遵循命名约定,不会生成结构化侧边栏和目录页。
|
||||
|
||||
* `docs/<结构化目录>` 请查看[《构建结构化站点的核心配置和约定》](/pages/33d574/)。
|
||||
|
||||
* `docs/index.md` 首页
|
||||
* `vdoing` 存放在本地的vdoing主题文件,如果你想深度的修改主题,首先要在`docs/.vuepress/config.js`中配置使用的主题指向这个文件。
|
||||
|
||||
<code-group>
|
||||
<code-block title="config.js" active>
|
||||
|
||||
``` js
|
||||
module.exports = {
|
||||
// theme: 'vdoing', // npm主题依赖包
|
||||
theme: require.resolve('../../vdoing'), // 使用本地主题包
|
||||
}
|
||||
```
|
||||
|
||||
</code-block>
|
||||
|
||||
<code-block title="config.ts">
|
||||
|
||||
``` typescript
|
||||
import { resolve } from 'path'
|
||||
import { defineConfig4CustomTheme } from 'vuepress/config'
|
||||
import { VdoingThemeConfig } from 'vuepress-theme-vdoing/types'
|
||||
export default defineConfig4CustomTheme<VdoingThemeConfig>({
|
||||
// theme: 'vdoing', // 使用npm主题包
|
||||
theme: resolve(__dirname, '../../vdoing'), // 使用本地主题包
|
||||
})
|
||||
```
|
||||
|
||||
</code-block>
|
||||
</code-group>
|
||||
|
||||
**注意**:主题的后续维护升级只对npm主题包负责,就是说你使用本地主题就等于放弃了后续的升级服务。因此,建议能在`docs/.vuepress/`内配置和修改的,就尽量不要改动主题内部代码。
|
||||
|
||||
---
|
||||
-->
|
||||
|
||||
::: tip 提示
|
||||
为了方便您更快的学习和使用本主题,我在代码当中添加了比较多的注释说明。
|
||||
:::
|
||||
@@ -1,373 +0,0 @@
|
||||
---
|
||||
title: Markdown 容器
|
||||
date: 2020-05-29 11:16:18
|
||||
permalink: /pages/d0d7eb/
|
||||
article: false
|
||||
---
|
||||
|
||||
Markdown 容器是对 Markdown 语法的一个扩展,使用简单的语法就可以在页面中呈现丰富的效果。
|
||||
|
||||
除了原默认主题自带的容器外,本主题还新增了一些好用的自定义容器。
|
||||
|
||||
## 信息框容器
|
||||
**输入**
|
||||
```` md
|
||||
::: tip
|
||||
这是一条提示
|
||||
:::
|
||||
|
||||
::: warning
|
||||
这是一条注意
|
||||
:::
|
||||
|
||||
::: danger
|
||||
这是一条警告
|
||||
:::
|
||||
|
||||
::: note
|
||||
这是笔记容器,在 <Badge text="v1.5.0 +" /> 版本才支持哦~
|
||||
:::
|
||||
````
|
||||
|
||||
**输出**
|
||||
::: tip
|
||||
这是一条提示
|
||||
:::
|
||||
|
||||
::: warning
|
||||
这是一条注意
|
||||
:::
|
||||
|
||||
::: danger
|
||||
这是一条警告
|
||||
:::
|
||||
|
||||
::: note
|
||||
这是笔记容器,在 <Badge text="v1.5.0 +" /> 以上版本才支持哦~
|
||||
:::
|
||||
|
||||
以上容器均可自定义标题,如:
|
||||
````
|
||||
::: tip 我的提示
|
||||
自定义标题的提示框
|
||||
:::
|
||||
````
|
||||
::: tip 我的提示
|
||||
自定义标题的提示框
|
||||
:::
|
||||
|
||||
## 布局容器 <Badge text="v1.3.3 +" />
|
||||
**输入**
|
||||
```` md
|
||||
::: center
|
||||
### 我是居中的内容
|
||||
(可用于标题、图片等的居中)
|
||||
:::
|
||||
|
||||
::: right
|
||||
[我是右浮动的内容](https://zh.wikipedia.org/wiki/%E7%89%9B%E9%A1%BF%E8%BF%90%E5%8A%A8%E5%AE%9A%E5%BE%8B)
|
||||
:::
|
||||
|
||||
::: details
|
||||
这是一个详情块,在 IE / Edge 中不生效
|
||||
```js
|
||||
console.log('这是一个详情块')
|
||||
```
|
||||
:::
|
||||
|
||||
::: theorem 牛顿第一定律
|
||||
假若施加于某物体的外力为零,则该物体的运动速度不变。
|
||||
::: right
|
||||
来自 [维基百科](https://zh.wikipedia.org/wiki/%E7%89%9B%E9%A1%BF%E8%BF%90%E5%8A%A8%E5%AE%9A%E5%BE%8B)
|
||||
:::
|
||||
````
|
||||
|
||||
**输出**
|
||||
::: center
|
||||
### 我是居中的内容
|
||||
(可用于标题、图片等的居中)
|
||||
:::
|
||||
|
||||
::: right
|
||||
[我是右浮动的内容](https://zh.wikipedia.org/wiki/%E7%89%9B%E9%A1%BF%E8%BF%90%E5%8A%A8%E5%AE%9A%E5%BE%8B)
|
||||
:::
|
||||
|
||||
::: details
|
||||
这是一个详情块,在 IE / Edge 中不生效
|
||||
```js
|
||||
console.log('这是一个详情块')
|
||||
```
|
||||
:::
|
||||
|
||||
::: theorem 牛顿第一定律
|
||||
假若施加于某物体的外力为零,则该物体的运动速度不变。
|
||||
|
||||
::: right
|
||||
来自 [维基百科](https://zh.wikipedia.org/wiki/%E7%89%9B%E9%A1%BF%E8%BF%90%E5%8A%A8%E5%AE%9A%E5%BE%8B)
|
||||
:::
|
||||
|
||||
> 注意:`right`、`details`、`theorem`这三个容器在`v1.3.0 +`版本才支持。`center`容器在`v1.3.3 +`版本才支持。
|
||||
|
||||
|
||||
## 普通卡片列表 <Badge text="v1.1.0 +"/>
|
||||
|
||||
普通卡片列表容器,可用于`友情链接`、`项目推荐`、`诗词展示`等。
|
||||
|
||||
先来看看效果:
|
||||
|
||||
**输出**
|
||||
::: cardList
|
||||
```yaml
|
||||
- name: 麋鹿鲁哟
|
||||
desc: 大道至简,知易行难
|
||||
avatar: https://fastly.jsdelivr.net/gh/xugaoyi/image_store/blog/20200122153807.jpg # 可选
|
||||
link: https://www.cnblogs.com/miluluyo/ # 可选
|
||||
bgColor: '#CBEAFA' # 可选,默认var(--bodyBg)。颜色值有#号时请添加单引号
|
||||
textColor: '#6854A1' # 可选,默认var(--textColor)
|
||||
- name: XAOXUU
|
||||
desc: '#IOS #Volantis主题作者'
|
||||
avatar: https://fastly.jsdelivr.net/gh/xaoxuu/assets@master/avatar/avatar.png
|
||||
link: https://xaoxuu.com
|
||||
bgColor: '#718971'
|
||||
textColor: '#fff'
|
||||
- name: 平凡的你我
|
||||
desc: 理想成为大牛的小陈同学
|
||||
avatar: https://reinness.com/avatar.png
|
||||
link: https://reinness.com
|
||||
bgColor: '#FCDBA0'
|
||||
textColor: '#A05F2C'
|
||||
```
|
||||
:::
|
||||
|
||||
上面效果在Markdown中的代码是这样的:
|
||||
|
||||
**输入**
|
||||
```` md
|
||||
::: cardList
|
||||
```yaml
|
||||
- name: 麋鹿鲁哟
|
||||
desc: 大道至简,知易行难
|
||||
avatar: https://fastly.jsdelivr.net/gh/xugaoyi/image_store/blog/20200122153807.jpg # 可选
|
||||
link: https://www.cnblogs.com/miluluyo/ # 可选
|
||||
bgColor: '#CBEAFA' # 可选,默认var(--bodyBg)。颜色值有#号时请添加单引号
|
||||
textColor: '#6854A1' # 可选,默认var(--textColor)
|
||||
- name: XAOXUU
|
||||
desc: '#IOS #Volantis主题作者'
|
||||
avatar: https://fastly.jsdelivr.net/gh/xaoxuu/assets@master/avatar/avatar.png
|
||||
link: https://xaoxuu.com
|
||||
bgColor: '#718971'
|
||||
textColor: '#fff'
|
||||
- name: 平凡的你我
|
||||
desc: 理想成为大牛的小陈同学
|
||||
avatar: https://reinness.com/avatar.png
|
||||
link: https://reinness.com
|
||||
bgColor: '#FCDBA0'
|
||||
textColor: '#A05F2C'
|
||||
```
|
||||
:::
|
||||
````
|
||||
|
||||
|
||||
### 语法
|
||||
````md
|
||||
::: cardList <每行显示数量>
|
||||
``` yaml
|
||||
- name: 名称
|
||||
desc: 描述
|
||||
avatar: https://xxx.jpg # 头像,可选
|
||||
link: https://xxx/ # 链接,可选
|
||||
bgColor: '#CBEAFA' # 背景色,可选,默认var(--bodyBg)。颜色值有#号时请添加引号
|
||||
textColor: '#6854A1' # 文本色,可选,默认var(--textColor)
|
||||
```
|
||||
:::
|
||||
````
|
||||
|
||||
* `<每行显示数量>` 数字,表示每行最多显示多少个,选值范围1~4,默认3。在小屏时会根据屏幕宽度减少每行显示数量。
|
||||
* 代码块需指定语言为`yaml`
|
||||
* 代码块内是一个`yaml`格式的数组列表
|
||||
* 数组成员的属性有:
|
||||
* `name`名称
|
||||
* `desc`描述
|
||||
* `avatar`头像,可选
|
||||
* `link`链接,可选
|
||||
* `bgColor`背景色,可选,默认`var(--bodyBg)`。颜色值有`#`号时请添加引号
|
||||
* `textColor`文本色,可选,默认`var(--textColor)`
|
||||
|
||||
下面再来看另外一个示例:
|
||||
|
||||
**输入**
|
||||
```` md
|
||||
::: cardList 2
|
||||
```yaml
|
||||
- name: 《静夜思》
|
||||
desc: 床前明月光,疑是地上霜。举头望明月,低头思故乡。
|
||||
bgColor: '#F0DFB1'
|
||||
textColor: '#242A38'
|
||||
- name: Vdoing
|
||||
desc: 🚀一款简洁高效的VuePress 知识管理&博客(blog) 主题
|
||||
link: https://github.com/xugaoyi/vuepress-theme-vdoing
|
||||
bgColor: '#DFEEE7'
|
||||
textColor: '#2A3344'
|
||||
```
|
||||
:::
|
||||
````
|
||||
|
||||
|
||||
**输出**
|
||||
::: cardList 2
|
||||
```yaml
|
||||
- name: 《静夜思》
|
||||
desc: 床前明月光,疑是地上霜。举头望明月,低头思故乡。
|
||||
bgColor: '#F0DFB1'
|
||||
textColor: '#242A38'
|
||||
- name: Vdoing
|
||||
desc: 🚀一款简洁高效的VuePress 知识管理&博客(blog) 主题
|
||||
link: https://github.com/xugaoyi/vuepress-theme-vdoing
|
||||
bgColor: '#DFEEE7'
|
||||
textColor: '#2A3344'
|
||||
```
|
||||
:::
|
||||
|
||||
|
||||
|
||||
|
||||
## 图文卡片列表 <Badge text="v1.1.0 +" />
|
||||
|
||||
图文卡片列表容器,可用于`项目展示`、`产品展示`等。
|
||||
|
||||
先看效果:
|
||||
|
||||
**输出**
|
||||
::: cardImgList
|
||||
```yaml
|
||||
- img: https://fastly.jsdelivr.net/gh/xugaoyi/image_store/blog/20200529162253.jpg
|
||||
link: https://xugaoyi.com/
|
||||
name: 标题
|
||||
desc: 描述内容描述内容描述内容描述内容描述内容描述内容描述内容描述内容 # 描述,可选
|
||||
author: Evan Xu # 作者,可选
|
||||
avatar: https://fastly.jsdelivr.net/gh/xugaoyi/image_store/blog/20200103123203.jpg # 头像,可选
|
||||
- img: https://fastly.jsdelivr.net/gh/xugaoyi/image_store/blog/20200530100256.jpg
|
||||
link: https://xugaoyi.com/
|
||||
name: 标题
|
||||
desc: 描述内容描述内容描述内容描述内容描述内容描述内容描述内容描述内容
|
||||
author: Evan Xu
|
||||
avatar: https://fastly.jsdelivr.net/gh/xugaoyi/image_store/blog/20200103123203.jpg
|
||||
- img: https://fastly.jsdelivr.net/gh/xugaoyi/image_store/blog/20200530100257.jpg
|
||||
link: https://xugaoyi.com/
|
||||
name: 标题
|
||||
desc: 描述内容描述内容描述内容描述内容描述内容描述内容描述内容描述内容
|
||||
author: Evan Xu
|
||||
avatar: https://fastly.jsdelivr.net/gh/xugaoyi/image_store/blog/20200103123203.jpg
|
||||
```
|
||||
:::
|
||||
|
||||
**输入**
|
||||
````md
|
||||
::: cardImgList
|
||||
```yaml
|
||||
- img: https://fastly.jsdelivr.net/gh/xugaoyi/image_store/blog/20200529162253.jpg
|
||||
link: https://xugaoyi.com/
|
||||
name: 标题
|
||||
desc: 描述内容描述内容描述内容描述内容描述内容描述内容描述内容描述内容 # 描述,可选
|
||||
author: Evan Xu # 作者,可选
|
||||
avatar: https://fastly.jsdelivr.net/gh/xugaoyi/image_store/blog/20200103123203.jpg # 头像,可选
|
||||
- img: https://fastly.jsdelivr.net/gh/xugaoyi/image_store/blog/20200530100256.jpg
|
||||
link: https://xugaoyi.com/
|
||||
name: 标题
|
||||
desc: 描述内容描述内容描述内容描述内容描述内容描述内容描述内容描述内容
|
||||
author: Evan Xu
|
||||
avatar: https://fastly.jsdelivr.net/gh/xugaoyi/image_store/blog/20200103123203.jpg
|
||||
- img: https://fastly.jsdelivr.net/gh/xugaoyi/image_store/blog/20200530100257.jpg
|
||||
link: https://xugaoyi.com/
|
||||
name: 标题
|
||||
desc: 描述内容描述内容描述内容描述内容描述内容描述内容描述内容描述内容
|
||||
author: Evan Xu
|
||||
avatar: https://fastly.jsdelivr.net/gh/xugaoyi/image_store/blog/20200103123203.jpg
|
||||
```
|
||||
:::
|
||||
````
|
||||
|
||||
|
||||
### 语法
|
||||
````md
|
||||
::: cardImgList <每行显示数量>
|
||||
``` yaml
|
||||
- img: https://xxx.jpg # 图片地址
|
||||
link: https://xxx.com # 链接地址
|
||||
name: 标题
|
||||
desc: 描述 # 可选
|
||||
author: 作者名称 # 可选
|
||||
avatar: https://xxx.jpg # 作者头像,可选
|
||||
```
|
||||
:::
|
||||
````
|
||||
* `<每行显示数量>` 数字,表示每行最多显示多少个,选值范围1~4,默认3。在小屏时会根据屏幕宽度减少每行显示数量。
|
||||
* 代码块需指定语言为`yaml`
|
||||
* 代码块内是一个`yaml`格式的数组列表
|
||||
* 数组成员的属性有:
|
||||
* `img`图片地址
|
||||
* `link`链接地址
|
||||
* `name`标题
|
||||
* `desc`描述,可选
|
||||
* `author`作者名称,可选
|
||||
* `avatar`作者头像,可选
|
||||
|
||||
|
||||
## 增强配置 <Badge text="v1.9.0 +"/>
|
||||
为了适应更多需求场景,`v1.9.0+`版本的普通卡片和图文卡片容器添加了一些新的配置:
|
||||
|
||||
### 1. 普通卡片和图文卡片容器
|
||||
|
||||
#### target
|
||||
- 链接的打开方式,默认`_blank`
|
||||
|
||||
- `_self` 当前页面
|
||||
|
||||
- `_blank` 新窗口打开
|
||||
|
||||
|
||||
|
||||
### 2. 图文卡片容器
|
||||
|
||||
#### imgHeight
|
||||
- 设置图片高度,默认 `auto`
|
||||
|
||||
- 带单位
|
||||
|
||||
|
||||
#### objectFit
|
||||
- 设置图片的填充方式(object-fit),默认 `cover`
|
||||
|
||||
- `fill` 拉伸 (会改变宽高比)
|
||||
- `contain` 缩放 (保持宽高比,会留空)
|
||||
- `cover` 填充 (会裁剪)
|
||||
- `none` 保持原有尺寸 (会留空或裁剪)
|
||||
- `scale-down` 保证显示完整图片 (保持宽高比,会留空)
|
||||
|
||||
|
||||
#### lineClamp
|
||||
- 描述文本超出多少行显示省略号,默认`1`
|
||||
|
||||
|
||||
|
||||
### 3. 配置示例:
|
||||
|
||||
````yaml
|
||||
::: cardImgList
|
||||
``` yaml
|
||||
config:
|
||||
target: _blank
|
||||
imgHeight: auto
|
||||
objectFit: cover
|
||||
lineClamp: 1
|
||||
|
||||
data:
|
||||
- img: https://xxx.jpg
|
||||
link: https://xugaoyi.com/
|
||||
name: 标题
|
||||
desc: 描述内容
|
||||
author: Evan Xu
|
||||
avatar: https://xxx.jpg
|
||||
```
|
||||
:::
|
||||
````
|
||||
@@ -1,70 +0,0 @@
|
||||
---
|
||||
title: Markdown 中使用组件
|
||||
date: 2020-11-10 18:56:22
|
||||
permalink: /pages/197691/
|
||||
article: false
|
||||
---
|
||||
|
||||
主题的内置组件可以直接在`Markdown`文件中以类似html标签的方式使用。
|
||||
|
||||
## 标记
|
||||
- **Props:**
|
||||
- `text`- string
|
||||
- `type` - string, 可选值: `tip | warning | error`,默认: `tip`
|
||||
- `vertical` - string, 可选值: `top | middle`,默认: `top`
|
||||
|
||||
- **Usage:**
|
||||
|
||||
你可以在标题或其他内容中使用标记:
|
||||
```md
|
||||
#### 《沁园春·雪》 <Badge text="摘"/>
|
||||
北国风光<Badge text="注释" type="warning"/>,千里冰封,万里雪飘。
|
||||
|
||||
> <Badge text="译文" type="error" vertical="middle"/>: 北方的风光。
|
||||
```
|
||||
**效果:**
|
||||
#### 《沁园春·雪》 <Badge text="摘"/>
|
||||
北国风光<Badge text="注释" type="warning"/>,千里冰封,万里雪飘。
|
||||
|
||||
> <Badge text="译文" type="error" vertical="middle"/>: 北方的风光。
|
||||
|
||||
## 代码块选项卡 <Badge text="v1.8.0 +"/>
|
||||
|
||||
在`<code-group>`中嵌套`<code-block>`来配合使用。在`<code-block>`标签添加`title`来指定tab标题,`active`指定当前tab:
|
||||
|
||||
````md
|
||||
<code-group>
|
||||
<code-block title="YARN" active>
|
||||
```bash
|
||||
yarn add vuepress-theme-vdoing -D
|
||||
```
|
||||
</code-block>
|
||||
|
||||
<code-block title="NPM">
|
||||
```bash
|
||||
npm install vuepress-theme-vdoing -D
|
||||
```
|
||||
</code-block>
|
||||
</code-group>
|
||||
````
|
||||
|
||||
**效果:**
|
||||
|
||||
<code-group>
|
||||
<code-block title="YARN" active>
|
||||
```bash
|
||||
yarn add vuepress-theme-vdoing -D
|
||||
```
|
||||
</code-block>
|
||||
|
||||
<code-block title="NPM">
|
||||
```bash
|
||||
npm install vuepress-theme-vdoing -D
|
||||
```
|
||||
</code-block>
|
||||
</code-group>
|
||||
|
||||
::: warning
|
||||
- 请在`<code-group>`标签与markdown内容之间使用空行隔开,否则可能会解析不出来。
|
||||
- 该组件只适用于放置代码块,放其他内容在体验上并不友好。如您确实需要放置其他内容的选项卡,推荐使用[vuepress-plugin-tabs](https://superbiger.github.io/vuepress-plugin-tabs)插件。
|
||||
:::
|
||||
@@ -0,0 +1,39 @@
|
||||
---
|
||||
title: 项目结构
|
||||
date: 2020-05-11 13:54:56
|
||||
permalink: /pages/2f674a
|
||||
article: false
|
||||
---
|
||||
|
||||
# 主要目录、文件
|
||||
|
||||
```
|
||||
├── data.db (为配置mysql时,项目启动默认初始化生成的本地sqlite数据库文件)
|
||||
├── docs (项目相关的一些文档)
|
||||
├── neutrino-proxy-admin (管理后台前端项目,基于vue-element-admin)
|
||||
├── neutrino-proxy-client (基于netty的代理客户端,用于和服务端交互、转发内网数据)
|
||||
├── neutrino-proxy-core (代理相关的公共代码(协议、常量))
|
||||
├── neutrino-proxy-server (基于netty的代理服务端,用于和客户段交互,将客户端转发的内网数据转发至外网端口)
|
||||
└── todolist.MD (近期的开发计划)
|
||||
```
|
||||
|
||||
# 代理服务端 `neutrino-proxy-server`
|
||||
- base:基础的配置、初始化代码
|
||||
- constant:服务端常量、枚举定义
|
||||
- dal:持久层mapper、实体
|
||||
- job:定时任务执行入口
|
||||
- proxy:代理核心实现
|
||||
- service:基础业务
|
||||
- util:基础工具封装
|
||||
- resource/mapper:mybatis SQL文件
|
||||
- resource/sql:维护mysql/sqlite的初始化SQL、SQL变更记录
|
||||
- resource/app.yml:项目默认配置
|
||||
- resource/test.jks:默认的SSL证书
|
||||
|
||||
# 代理客户端 `neutrino-proxy-client`
|
||||
- config:基础配置
|
||||
- core:客户端代理核心入口
|
||||
- handler:客户端代理数据处理逻辑
|
||||
- util:基础工具封装
|
||||
- resource/app.yml:项目默认配置
|
||||
- resource/test.jks:默认的SSL证书
|
||||
@@ -0,0 +1,61 @@
|
||||
---
|
||||
title: 实现原理
|
||||
date: 2020-09-26 21:13:59
|
||||
permalink: /pages/dd027d/
|
||||
article: false
|
||||
---
|
||||
|
||||
# 代理实现中涉及的几类Channel
|
||||
|
||||
## 指令通道(CmdChannel)
|
||||
- 该channel负责维护客户端与服务端之间的指令通讯,由客户端启动后向服务端发起连接请求,服务端验证license成功后连接建立。
|
||||
- 服务端维护第一个CmdChannel的映射表,key为licenseId。服务端可以根据licenseId,向指定的客户端指令通道发布指令。
|
||||
- 该通道建立完成后,服务端会将该license授权的外网映射端口打开,等待用户访问。正常情况下,只要客户端不下线,该通道一直可用。
|
||||
- 然后服务端维护第二个CmdChannel的映射表,key为服务端外网端口。服务端可以根据指定的外网端口,向指定的客户端指令通道发布指令。
|
||||
|
||||
## 用户访问通道(VisitorChannel)
|
||||
- 该channel负责维护访问者与服务端端口之间的通讯,由访问者向服务端映射的外网端口发起请求开始建立,具体断开时机由实际的被代理的
|
||||
协议决定。
|
||||
- 如HTTP/1.0下,用户向该端口发起请求,响应结束后,该通道随之关闭,下一次发起请求后,重新建立新的连接。
|
||||
- 该连接建立后,服务端会向该外网端口映射的指令通道发送`Connect`指令,传输该外网端口需要代理的内网信息,
|
||||
如:`127.0.0.1:3306`。
|
||||
|
||||
## 被代理服务的实际通道(RealServerChannel)
|
||||
- 该channel负责维护客户端与实际被代理服务之间的通讯,当客户端接收到服务端的`Connect`指令后,客户端便会建立该通道。
|
||||
|
||||
## 代理数据传输的通道(ProxyChannel)
|
||||
- 该channel负责完成内网被代理服务与代理服务端之间的数据转发任务。
|
||||
- 每个客户端维护一个`ProxyChannel`的缓存队列,需要时从该队列中取,当取不到时,直接新建一个`ProxyChannel`返回。
|
||||
当一个`ProxyChannel`实例用完后,需要归还到缓存队列中(`ProxyChannel`收到`DisConnect`指令时)。
|
||||
- 当`RealServerChannel`建立完成后,就会获取相关联的`ProxyChannel`,并与其绑定。设置`RealServerChannel`为
|
||||
可读状态。然后通过`ProxyChannel`向服务端发送`Connect`指令。
|
||||
|
||||
|
||||
# 代理实现流程
|
||||
## 1、服务连接阶段
|
||||
- 1.1、客户端根据是否需要使用SSL,选择对应的服务端端口发起连接,建立`CmdChannel`。
|
||||
- 1.2、客户端根据用户输入或配置文件获取`license`,并携带`license`通过`CmdChannel`向服务端发送`Auth`指令。
|
||||
- 1.3、服务端通过`CmdChannel`接收到来自客户端的`Auth`指令。若验证`license`有效,则建立`licenseId`与`CmdChannel`的映射缓存、
|
||||
外网端口与`CmdChannel`的映射缓存。并启动服务端代理端口,等待用户连接。
|
||||
## 2、用户连接阶段
|
||||
- 2.1、用户向服务端代理的外网端口发起请求,服务端建立`VisitorChannel`。
|
||||
- 2.2、根据外网端口查找`CmdChannel`,若不存在有效的`CmdChannel`,则关闭该`VisitorChannel`。否则,
|
||||
设置`VisitorChannel`为不可读,并携带内网映射信息(如:`127.0.0.1:3306`)通过`CmdChannel`向客户端发送`Connect`指令。
|
||||
## 3、实际被代理服务连接阶段
|
||||
- 3.1、客户端通过`CmdChannel`接收到服务端的`Connect`指令。拿到需要代理的内网IP、端口号,向实际被
|
||||
代理服务发起连接请求,若连接失败,则通过`CmdChannel`向服务端发送`DisConnect`指令。建立`RealServerChannel`成功,设置`RealServerChannel`为不可读
|
||||
状态,并进入4.1阶段
|
||||
## 4、代理通道连接阶段
|
||||
- 4.1、客户端通过`ProxyChannelQueue`获取或新建一个`ProxyChannel`,并将`RealServerChannel`与`ProxyChannel`进行绑定。
|
||||
- 4.2、客户端通过`ProxyChannel`向服务端发送`Connect`指令。
|
||||
- 4.3、服务端通过`ProxyChannel`通道收到来自客户端的`Connect`指令后,将`ProxyChannel`与对应的`VisitorChannel`进行绑定,并
|
||||
设置`VisitorChannel`为可读状态。
|
||||
## 5、数据传输阶段
|
||||
- 5.1、服务端通过`VisitorChannel`收到来自用户的请求数据,然后找到`VisitorChannel`绑定的`ProxyChannel`,
|
||||
通过`ProxyChannel`发送`Transfer`指令,并携带用户请求数据。
|
||||
- 5.2、客户端通过`ProxyChannel`收到来自服务端的`Transfer`指令,取出用户请求数据。找到`ProxyChannel`绑定的`RealServerChannel`,
|
||||
通过`RealServerChannel`向被代理服务写入用户请求数据。
|
||||
- 5.3、客户端通过`RealServerChannel`收到被代理服务响应的数据,找到`RealServerChannel`绑定的`ProxyChannel`,
|
||||
通过`ProxyChannel`向服务端发送`Transfer`指令,并携带响应数据。
|
||||
- 5.4、服务端通过`ProxyChannel`收到来自客户端的`Transfer`指令,找到`ProxyChannel`绑定的`VisitorChannel`,
|
||||
通过`VisitorChannel`向用户端写入响应数据。
|
||||
@@ -1,26 +0,0 @@
|
||||
---
|
||||
title: 使目录栏支持h2~h6标题
|
||||
date: 2022-03-18 15:02:52
|
||||
permalink: /pages/8dfab5/
|
||||
article: false
|
||||
---
|
||||
|
||||
在`.vuepress/config.js`添加如下配置即可使 VuePress 提取相应标题级别的数据,并应用到主题的右侧目录栏中<Badge text="v1.10.0 +"/>。
|
||||
|
||||
|
||||
## markdown.extractHeaders
|
||||
|
||||
- 类型: Array
|
||||
- 默认: ['h2', 'h3']
|
||||
|
||||
Markdown 文件的 headers (标题 & 小标题) 会在准备阶段被提取出来,并存储在 this.$page.headers 中。默认情况下,VuePress 会提取 h2 和 h3 标题。你可以通过这个选项来修改提取出的标题级别。
|
||||
|
||||
```js
|
||||
module.exports = {
|
||||
markdown: {
|
||||
extractHeaders: [ 'h2', 'h3', 'h4', 'h5', 'h6' ]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
注:此配置来自 [VuePress官方文档](https://vuepress.vuejs.org/zh/config/#markdown-extractheaders)
|
||||
@@ -1,230 +0,0 @@
|
||||
---
|
||||
title: 如何让你的笔记更有表现力
|
||||
date: 2020-09-26 21:13:59
|
||||
permalink: /pages/dd027d/
|
||||
article: false
|
||||
---
|
||||
|
||||
你的知识笔记枯燥无味没有重点?基于本主题,配合各种骚操作,让你的知识笔记表现力爆棚~~
|
||||
|
||||
::: note
|
||||
Markdown的基本语法就不再重复啦 (对Markdown不了解的可以看 [这里](https://xugaoyi.com/pages/ad247c4332211551/)),
|
||||
下面将介绍一些可以在本主题Markdown中使用的骚操作~
|
||||
:::
|
||||
|
||||
## 1. 文本高亮
|
||||
使用`<mark>`标签让文本高亮
|
||||
|
||||
```text
|
||||
Vdoing是一款简洁高效的 <mark>知识管理&博客</mark> 主题
|
||||
```
|
||||
Vdoing是一款简洁高效的 <mark> 知识管理&博客 </mark> 主题
|
||||
|
||||
## 2. 标记
|
||||
### 内置标记
|
||||
主题内置的[Badge组件](https://vuepress.vuejs.org/zh/guide/using-vue.html#badge),直接在 Markdown 文件中使用
|
||||
|
||||
```html
|
||||
<Badge text="beta" type="warning"/>
|
||||
<Badge text="Vdoing主题"/>
|
||||
```
|
||||
<Badge text="beta" type="warning"/>
|
||||
<Badge text="Vdoing主题"/>
|
||||
|
||||
### 外部标记
|
||||
使用 [shields](https://shields.io/) 生成标记,在Markdown中使用
|
||||
```markdown
|
||||

|
||||

|
||||
```
|
||||

|
||||

|
||||
|
||||
> 这类标记图标可以生成动态统计数据。
|
||||
|
||||
## 3. 折叠列表
|
||||
主题内置的容器,直接在 Markdown 文件中使用
|
||||
````html
|
||||
::: details
|
||||
这是一个详情块
|
||||
```js
|
||||
console.log('这是一个详情块')
|
||||
```
|
||||
:::
|
||||
````
|
||||
::: details
|
||||
这是一个详情块
|
||||
```js
|
||||
console.log('这是一个详情块')
|
||||
```
|
||||
:::
|
||||
|
||||
> 更多:[Markdown 容器](/pages/d0d7eb/)
|
||||
|
||||
## 4. 思维导图 & 流程图
|
||||
### 方法一:
|
||||
1. 使用[Markmap](https://markmap.js.org/)生成思维导图html文件
|
||||
2. 将html文件放在`docs/.vuepress/public/markmap/`
|
||||
3. 通过`<iframe>`插入到Markdown
|
||||
|
||||
``` html
|
||||
<iframe :src="$withBase('/markmap/01.html')" width="100%" height="400" frameborder="0" scrolling="No" leftmargin="0" topmargin="0"></iframe>
|
||||
```
|
||||
|
||||
<iframe :src="$withBase('/markmap/01.html')" width="100%" height="400" frameborder="0" scrolling="No" leftmargin="0" topmargin="0"></iframe>
|
||||
|
||||
### 方法二:
|
||||
通过`<iframe>`标签引入[processon](https://www.processon.com/)或其他在线作图工具生成的链接。
|
||||
```html
|
||||
<iframe src="https://www.processon.com/view/link/5e718942e4b015182028682c" width="100%" height="500" frameborder="0" scrolling="No" leftmargin="0" topmargin="0"></iframe>
|
||||
```
|
||||
<iframe src="https://www.processon.com/view/link/5e718942e4b015182028682c" width="100%" height="500" frameborder="0" scrolling="No" leftmargin="0" topmargin="0"></iframe>
|
||||
|
||||
### 方法三:
|
||||
使用流程图插件:
|
||||
* [vuepress-plugin-flowchart](https://www.npmjs.com/package/vuepress-plugin-flowchart)
|
||||
* [vuepress-plugin-mermaidjs](https://github.com/eFrane/vuepress-plugin-mermaidjs)
|
||||
|
||||
## 5.Demo演示框
|
||||
### 方法一:
|
||||
1. 安装 [vuepress-plugin-demo-block](https://www.npmjs.com/package/vuepress-plugin-demo-block)或其他同类插件,使用方法看插件文档
|
||||
2. 在`.vuepress/config.js`配置插件
|
||||
3. Markdown中使用
|
||||
|
||||
> 同类插件:[vuepress-plugin-demo-container](https://github.com/calebman/vuepress-plugin-demo-container)
|
||||
|
||||
|
||||
::: demo [vanilla]
|
||||
```html
|
||||
<html>
|
||||
<div class="animationBox">
|
||||
<div class="rotate">旋转动画1</div>
|
||||
<div class="play">
|
||||
<div class="img">旋转动画2</div>
|
||||
<span><p class="p2"></p></span>
|
||||
<span><p></p></span>
|
||||
<span><p></p></span>
|
||||
<span><p class="p2"></p></span>
|
||||
</div>
|
||||
<div class="elasticity">弹性动画</div>
|
||||
<div class="elasticity2">曲线弹性</div>
|
||||
</div>
|
||||
</html>
|
||||
|
||||
<style>
|
||||
.animationBox{overflow: hidden;}
|
||||
.animationBox>div{
|
||||
width: 100px;height: 100px;background: #eee;border-radius: 50%;text-align: center;line-height: 100px;margin: 30px;float:left;
|
||||
}
|
||||
.rotate{
|
||||
animation: rotate 5s linear infinite
|
||||
}
|
||||
.rotate:hover{ animation-play-state: paused}
|
||||
@keyframes rotate {
|
||||
0%{transform: rotate(0);}
|
||||
100%{transform: rotate(360deg);}
|
||||
}
|
||||
.animationBox>.play {
|
||||
position: relative;
|
||||
margin: 50px 30px;
|
||||
background:none;
|
||||
}
|
||||
.play .img{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left:0;
|
||||
z-index: 1;
|
||||
width: 100px;height: 100px; background: #eee;
|
||||
border-radius: 50%;
|
||||
|
||||
animation: rotate 5s linear infinite
|
||||
}
|
||||
.play span {
|
||||
position: absolute;
|
||||
top: 1px;
|
||||
left:1px;
|
||||
z-index: 0;
|
||||
display: block;
|
||||
width: 96px;
|
||||
height: 96px;
|
||||
border: 1px solid #999;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.play span p{display: block;width: 4px;height: 4px;background: #000;margin: -2px 0 0 50%;border-radius: 50%;opacity: 0.5;}
|
||||
.play span .p2{margin: 50% 0 0 -2px;}
|
||||
.play span{
|
||||
animation: wave 5s linear infinite
|
||||
}
|
||||
.play>span:nth-child(3){
|
||||
/* 延迟时间 */
|
||||
animation-delay:1s;
|
||||
}
|
||||
.play>span:nth-child(4){
|
||||
animation-delay:2.2s;
|
||||
}
|
||||
.play>span:nth-child(5){
|
||||
animation-delay:3.8s;
|
||||
}
|
||||
|
||||
@keyframes wave {
|
||||
0%
|
||||
{
|
||||
transform:scale(1) rotate(360deg);
|
||||
opacity: 0.8;
|
||||
}
|
||||
100%
|
||||
{
|
||||
transform:scale(1.8) rotate(0deg);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.elasticity{
|
||||
animation: elasticity 1s linear 2s infinite
|
||||
}
|
||||
|
||||
@keyframes elasticity{
|
||||
0%{
|
||||
transform: scale(0);
|
||||
}
|
||||
60%{
|
||||
transform: scale(1.1);
|
||||
}
|
||||
90%{
|
||||
transform: scale(1);
|
||||
}
|
||||
}
|
||||
|
||||
.elasticity2{
|
||||
animation: elasticity2 1s cubic-bezier(.39,.62,.74,1.39) 2s infinite
|
||||
}
|
||||
@keyframes elasticity2{
|
||||
0%{
|
||||
transform: scale(0);
|
||||
}
|
||||
90%{
|
||||
transform: scale(1);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
```
|
||||
:::
|
||||
|
||||
### 方法二:
|
||||
嵌入[codepen](https://codepen.io/)
|
||||
|
||||
```html
|
||||
<iframe height="400" style="width: 100%;" scrolling="no" title="【CSS:行为】使用:hover和attr()定制悬浮提示" src="https://codepen.io/xugaoyi/embed/vYNKNaq?height=400&theme-id=light&default-tab=css,result" frameborder="no" allowtransparency="true" allowfullscreen="true" loading="lazy">
|
||||
See the Pen <a href='https://codepen.io/xugaoyi/pen/vYNKNaq'>【CSS:行为】使用:hover和attr()定制悬浮提示</a> by xugaoyi
|
||||
(<a href='https://codepen.io/xugaoyi'>@xugaoyi</a>) on <a href='https://codepen.io'>CodePen</a>.
|
||||
</iframe>
|
||||
```
|
||||
<iframe height="400" style="width: 100%;" scrolling="no" title="【CSS:行为】使用:hover和attr()定制悬浮提示" src="https://codepen.io/xugaoyi/embed/vYNKNaq?height=400&theme-id=light&default-tab=css,result" frameborder="no" allowtransparency="true" allowfullscreen="true" loading="lazy">
|
||||
See the Pen <a href='https://codepen.io/xugaoyi/pen/vYNKNaq'>【CSS:行为】使用:hover和attr()定制悬浮提示</a> by xugaoyi
|
||||
(<a href='https://codepen.io/xugaoyi'>@xugaoyi</a>) on <a href='https://codepen.io'>CodePen</a>.
|
||||
</iframe>
|
||||
|
||||
::: note
|
||||
`<iframe>`标签还可以嵌入其他任何外部网页,如视频、地图等
|
||||
:::
|
||||
@@ -1,67 +0,0 @@
|
||||
---
|
||||
title: 批量操作front matter工具
|
||||
date: 2020-05-13 11:52:45
|
||||
permalink: /pages/2b8e22
|
||||
article: false
|
||||
---
|
||||
|
||||
当你想为某个文件夹下的所有`.md`文件添加、修改、删除某些front matter字段时,这个工具可以快速的为你批量操作。
|
||||
|
||||
首先,你需要在`package.json`的`scripts`中写入脚本:
|
||||
```json
|
||||
// package.json
|
||||
{
|
||||
"scripts": {
|
||||
"editFm": "node utils/editFrontmatter.js",
|
||||
}
|
||||
}
|
||||
```
|
||||
在`utils/config.yml`配置要批量操作的文件夹和要编辑的字段,示例:
|
||||
```yaml
|
||||
# utils/config.yml
|
||||
#批量添加和修改、删除front matter配置文件
|
||||
|
||||
# 需要批量处理的路径,docs文件夹内的文件夹 (数组。映射路径:docs/arr[1]/arr[2] ... )
|
||||
path:
|
||||
- docs # 第一个成员必须是docs
|
||||
- 《JS教程》专辑
|
||||
- 第一章节
|
||||
|
||||
# 要删除的字段 (数组)
|
||||
delete:
|
||||
- article
|
||||
|
||||
# 要添加、修改front matter的数据 (front matter中没有的数据则添加,已有的数据则覆盖)
|
||||
data:
|
||||
author: 齐天大圣
|
||||
sidebar: false
|
||||
```
|
||||
|
||||
比如你要操作的文件夹路径是`docs/《JS教程》专辑/第一章节`,你需要这样配置路径:
|
||||
```yaml
|
||||
path:
|
||||
- docs # 第一个成员必须是docs
|
||||
- 《JS教程》专辑
|
||||
- 第一章节
|
||||
```
|
||||
`path`数组的第一个成员必须是`docs`,如果你想操作`docs`底下除了首页之外所有的`.md`文件,只需保留第一个成员`docs`即可。
|
||||
|
||||
你想删除`article`字段:
|
||||
```yaml
|
||||
delete:
|
||||
- article
|
||||
```
|
||||
|
||||
你想为这个文件夹下的所有`.md`文件添加作者`author`和隐藏侧边栏`sidebar`:
|
||||
```yaml
|
||||
data:
|
||||
author: 齐天大圣
|
||||
sidebar: false
|
||||
```
|
||||
|
||||
最后,执行`npm run editFm`命令,为了防止误操作,会有一个询问过程:
|
||||
```sh
|
||||
npm run editFm
|
||||
? 批量操作frontmatter有修改数据的风险,确定要继续吗? (Y/n)
|
||||
...
|
||||
```
|
||||
@@ -1,84 +0,0 @@
|
||||
---
|
||||
title: 部署
|
||||
date: 2020-05-13 12:10:53
|
||||
permalink: /pages/0fc1d2
|
||||
article: false
|
||||
---
|
||||
|
||||
|
||||
::: warning
|
||||
目前作者使用的部署方式已改为 [vercel](https://vercel.com/),部署方法参考 [这里](https://zhuanlan.zhihu.com/p/347990778)。(2022.01.01)</br>
|
||||
更多 [部署方式](https://vuepress.vuejs.org/zh/guide/deploy.html#%E9%83%A8%E7%BD%B2)
|
||||
:::
|
||||
|
||||
本项目内置了两种`自动部署`脚本,用于一键部署到 GitHub Pages 或 国内访问速度更快的Coding Pages
|
||||
|
||||
## 1.使用deploy.sh脚本部署
|
||||
|
||||
第一步,修改`deploy.sh`脚本内的仓库地址为你的仓库,如有自定义域名则一并修改,没有则注释
|
||||
|
||||
```bash
|
||||
# 如果是发布到自定义域名
|
||||
echo 'xugaoyi.com' > CNAME
|
||||
|
||||
# 如果发布到 https://<USERNAME>.github.io
|
||||
# git push -f git@github.com:<USERNAME>/<USERNAME>.github.io.git master
|
||||
|
||||
# 如果发布到 https://<USERNAME>.github.io/<REPO>
|
||||
# git push -f git@github.com:<USERNAME>/<REPO>.git master:gh-pages
|
||||
```
|
||||
|
||||
第二步,一键部署命令
|
||||
|
||||
```bash
|
||||
npm run deploy
|
||||
```
|
||||
|
||||
> windows系统下使用bash命令窗
|
||||
|
||||
第三步,设置仓库的GitHub Pages。
|
||||
|
||||
> `deploy.sh`文件看 [这里](https://github.com/xugaoyi/vuepress-theme-vdoing/blob/master/deploy.sh)
|
||||
> 看不懂shell代码? 参考:[shell教程](https://ipcmen.com/)
|
||||
|
||||
|
||||
## 2. 使用GitHub Action自动持续集成
|
||||
|
||||
第一步,按照[官方文档](https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line),生成一个github token (令牌)。
|
||||
|
||||
第二步,将这个密钥储存到当前仓库的`Settings/Secrets`里面。
|
||||
|
||||
> `Settings/Secrets`是储存秘密的环境变量的地方。环境变量的名字可以随便起,这里用的是`ACCESS_TOKEN`。如果你不用这个名字,`.github/workflows/ci.yml`脚本里的变量名也要跟着改。
|
||||
|
||||
第三步,push提交代码到GitHub仓库master分支。
|
||||
|
||||
第四步,设置仓库的GitHub Pages
|
||||
|
||||
> 参考 [GitHub Action实现自动部署静态博客](http://xugaoyi.com/pages/6b9d359ec5aa5019/)
|
||||
> `ci.yml`文件看 [这里](https://github.com/xugaoyi/blog/blob/master/.github/workflows/ci.yml)
|
||||
> 看不懂yaml代码? 参考:[yaml教程](https://xugaoyi.com/pages/4e8444e2d534d14f/)
|
||||
|
||||
|
||||
## 部署升级:同时部署到github和coding
|
||||
|
||||
为了让博客站能够让百度收录,因此我把博客部署到了coding。相关[文章](https://xugaoyi.com/pages/41f87d890d0a02af/)。
|
||||
|
||||
在原有部署方式上做了升级,主要修改代码文件有下面这两个:
|
||||
|
||||
|
||||
使用前先将[github token (令牌) ](https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line)和[coding token (令牌)](https://dev.tencent.com/help/doc/account/access-token) 同时设置到github仓库的`Settings/Secrets`位置。
|
||||

|
||||
|
||||
### 部署方式有两种:
|
||||
|
||||
#### 1) 、使用如下命令一键部署到github和coding
|
||||
|
||||
```sh
|
||||
npm run deploy
|
||||
```
|
||||
|
||||
#### 2)、使用GitHub Action自动部署到github和coding
|
||||
|
||||
只需要push提交代码到github仓库master分支即可。
|
||||
|
||||
> 参考 [《GitHub Action实现自动部署静态博客》](http://xugaoyi.com/pages/6b9d359ec5aa5019/)
|
||||
@@ -1,30 +0,0 @@
|
||||
---
|
||||
title: 关于写文章和一级标题
|
||||
date: 2020-05-13 12:07:32
|
||||
permalink: /pages/9ae0bd
|
||||
article: false
|
||||
---
|
||||
|
||||
写文章时,大概的流程是这样的:
|
||||
|
||||
1.首先是创建`.md`文件,如果在结构化目录下则**需要**添加相应的序号,在碎片化博文目录`_posts`下**不需要**添加序号,文件名填写文章的标题。
|
||||
|
||||
2.如果你想手动指定文章的分类、标签,则需要在头部front matter填写相应的字段。一般情况下不需要再填写其他字段。不想手动指定分类和标签也可以省略这一步。
|
||||
``` yaml
|
||||
---
|
||||
categories:
|
||||
- 分类1
|
||||
tags:
|
||||
- 标签1
|
||||
- 标签2
|
||||
---
|
||||
```
|
||||
|
||||
3.**关于一级标题**,即markdown中的一级标题(`# 标题`),你可以写也可以不写,在页面中实际显示的文章标题是取自front matter中的`title`,然后把`.md`中的一级标题隐藏了。
|
||||
|
||||
> 这样做即可以保留本地文件的一级标题,也可以兼容线上页面的标题。
|
||||
> 同时,对于在新建`.md`文件时已经输入了一次标题在文件名,不想在文档中重复输入一次标题的,也是可以实现的。
|
||||
|
||||
4.**关于文章摘要**,你想在首先文章列表中显示摘要时可以在合适的位置添加一个`<!-- more -->`注释,参考:[添加摘要](/pages/1cc523/)
|
||||
|
||||
5.最后,就可以正式开始写作啦。
|
||||
@@ -1,35 +0,0 @@
|
||||
---
|
||||
title: 关于博客搭建与管理
|
||||
date: 2020-05-13 12:12:33
|
||||
permalink: /pages/26997d
|
||||
article: false
|
||||
---
|
||||
|
||||
这里是我在搭建和管理博客过程中写的一些文章和小技巧。
|
||||
|
||||
1. 评论模块的搭建
|
||||
|
||||
[使用Gitalk实现静态博客无后台评论系统](https://xugaoyi.com/pages/1da0bf9a988eafe5/)
|
||||
|
||||
2. 自定义域名及解析,[详情](https://github.com/xugaoyi/vuepress-theme-vdoing/issues/326)
|
||||
|
||||
3. SEO相关
|
||||
|
||||
```js
|
||||
// config.js
|
||||
module.exports = {
|
||||
description: '填写网站描述', // 以 <meta> 标签渲染到页面html中
|
||||
head: [ // 注入到页面<head> 中的标签,[tagName, { attrName: attrValue }]
|
||||
['meta', { name: 'keywords', content: '填写关键字'}]
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
4. 图床
|
||||
|
||||
[GitHub + jsDelivr + TinyPNG+ PicGo 打造稳定快速、高效免费图床](https://xugaoyi.com/pages/a5f73af5185fdf0a/)
|
||||
|
||||
5. 结合GitHub Actions开发的每天定时百度推送,加快收录
|
||||
|
||||
[GitHub Actions 定时运行代码:每天定时百度链接推送](https://xugaoyi.com/pages/f44d2f9ad04ab8d3/)
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
---
|
||||
title: 在线编辑和新增文章的方法
|
||||
date: 2020-05-19 11:17:58
|
||||
permalink: /pages/c5a54d
|
||||
article: false
|
||||
---
|
||||
::: warning 说明
|
||||
以下方法实现的前提是把博客源码上传到github仓库,并配置好 [GitHub Actions](https://github.com/features/actions) 自动部署。
|
||||
:::
|
||||
|
||||
### 在线编辑原有的文章
|
||||
首先,在`config.js`启用页面的编辑按钮,并配置好github仓库和`.md`文件所在根目录等,详见 [官方文档](https://vuepress.vuejs.org/zh/theme/default-theme-config.html#git-%E4%BB%93%E5%BA%93%E5%92%8C%E7%BC%96%E8%BE%91%E9%93%BE%E6%8E%A5)。
|
||||
|
||||
示例:
|
||||
```js
|
||||
// config.js
|
||||
module.exports = {
|
||||
themeConfig: {
|
||||
repo: 'xugaoyi/vuepress-theme-vdoing', // Github仓库地址
|
||||
docsDir: 'docs', // .md文件放在了docs目录下
|
||||
editLinks: true, // 启用编辑链接
|
||||
editLinkText: '编辑',
|
||||
}
|
||||
}
|
||||
```
|
||||
配置好之后,每个文章页面底下都会有一个编辑按钮,点击即可跳到github在线编辑,编辑完成后提交就会自动触发GitHub Actions自动部署。
|
||||
|
||||
### 在线新增文章
|
||||
在github博客源码仓库相应的文章目录下,新建`.md`文件,编辑好文章并提交后会触发GitHub Actions自动部署。
|
||||
|
||||
> 提示:当使用过在线编辑或新增后,下次在本地编辑之前先拉取代码。
|
||||
@@ -0,0 +1,43 @@
|
||||
---
|
||||
title: 如何贡献
|
||||
date: 2023-03-29 23:34:07
|
||||
permalink: /pages/a3f096/
|
||||
---
|
||||
|
||||
# 🎋代码分支说明
|
||||
- dev:常规开发分支,日常的开发、Bug修复、提交PR都在此分支
|
||||
- feature/xxx:特征分支,一些试验性开发、提交PR都在此分支,xxx可自行取一个有意义的名称
|
||||
- release/xxx:发行版分支,作为阶段性成果、重大更新的版本固化分支。受保护,不允许任何提交。
|
||||
- master:主分支,定期同步最新代码,目前仅支持本人(傲世孤尘/雨韵诗泽)提交。
|
||||
|
||||
# ✊贡献的方式
|
||||
包括,但不限于以下形式:
|
||||
- 提交[issues](https://gitee.com/dromara/neutrino-proxy/issues)
|
||||
- 参与[issues](https://gitee.com/dromara/neutrino-proxy/issues)解决的必要性、解决方案的讨论、给出建设性的意见
|
||||
- 领取[issues](https://gitee.com/dromara/neutrino-proxy/issues) 并完成开发、提交PR
|
||||
- 为[本项目](https://gitee.com/dromara/neutrino-proxy)完善代码注释
|
||||
- 为[本项目](https://gitee.com/dromara/neutrino-proxy)增加测试代码
|
||||
- 为[本项目](https://gitee.com/dromara/neutrino-proxy)优化现有代码
|
||||
- 为[本项目](https://gitee.com/dromara/neutrino-proxy)优化操作体验
|
||||
- 通过公众号、博客、贴吧、论坛等形式分享/宣传中微子代理
|
||||
- 丰富项目文档,包括使用过程中踩过的坑、需要优化的点、具体问题的解决方法等
|
||||
|
||||
# 🧬贡献代码的步骤
|
||||
- 在Gitee上fork项目到自己的仓库
|
||||
- 将fork后的自己仓库的项目clone到本地
|
||||
- 拉取dev分支最新代码,并修改
|
||||
- commit并push到自己的仓库
|
||||
- 登录Gitee在的仓库上可以看到一个 pull request 按钮,点击它,填写一些说明信息,然后提交即可。
|
||||
- 等待合并
|
||||
|
||||
# 📐PR的规范
|
||||
> 你可能发现有的代码并不符合这个规范,但我们后续都会朝着这个方向迈进。后续我们会逐步全面规范化,请先保证新提交的代码满足以下要求:
|
||||
|
||||
- 注释完备,尤其每个新增的方法应按照Java文档规范标明方法说明、参数说明、返回值说明等信息,必要时请添加单元测试,如果愿意,也可以加上你的大名。
|
||||
- 原则上,不允许自行添加第三方依赖库。若确有必要,请先和项目负责人沟通达成一致。
|
||||
- 对现有代码的优化,请在注释中说明原因。
|
||||
- 如果涉及到数据库的变更,则至少需要做到以下绩点:
|
||||
- sqlite、mysql下均测试通过
|
||||
- 在`./neutrino-proxy-server/src/main/resource/sql`下维护更新对应的表结构sql文件
|
||||
- 对于新增的表,维护必要的初始化数据
|
||||
- 在对应的mysql、sqlite的update目录下,维护SQL变更记录,确保SQL执行测试通过
|
||||
@@ -0,0 +1,39 @@
|
||||
---
|
||||
title: 最近更新
|
||||
date: 2020-05-25 12:01:52
|
||||
permalink: /pages/9cc27d
|
||||
# sidebar: false
|
||||
article: false
|
||||
---
|
||||
|
||||
# TODO
|
||||
|
||||
### 1.x剩余规划
|
||||
- [ ] 参考鹊桥,增加对域名的支持
|
||||
- [ ] 官网上线
|
||||
|
||||
#### Bug
|
||||
- windows环境下直接运行发布版的jar包,日志输出乱码
|
||||
- 代理mysql时,使用未开启远程访问的账号走代理访问mysql,代理客户端出现断开现象
|
||||
|
||||
### 2.x规划
|
||||
- 插件开发
|
||||
- [ ] neutrino-proxy-solon-plugin
|
||||
- [ ] neutrino-proxy-jetbrains-plugin
|
||||
- [ ] neutrino-proxy-starter (SpringBoot)
|
||||
- 基础优化
|
||||
- [ ] 支持批量端口映射
|
||||
- [ ] 代理协议规范化,方便后续更好扩展、支持不同语言客户端接入
|
||||
- 监控运维
|
||||
- [ ] 监控服务端状态
|
||||
- [ ] 支持调整服务端端口、证书
|
||||
- [ ] 服务端版本、协议版本、客户端版本管理
|
||||
- [ ] 服务端日志
|
||||
- client+计划启动
|
||||
- [ ] 安卓客户端
|
||||
- [ ] 基于electron-egg的多平台客户端
|
||||
|
||||
### 3.x规划
|
||||
- [ ] 支持针对用户限速、限流
|
||||
- [ ] 支持P2P穿透
|
||||
- [ ] 支持原生编译
|
||||
@@ -1,48 +0,0 @@
|
||||
---
|
||||
title: 问答
|
||||
date: 2020-05-25 12:01:52
|
||||
permalink: /pages/9cc27d
|
||||
# sidebar: false
|
||||
article: false
|
||||
---
|
||||
|
||||
## 我是一个小白,想使用这个主题搭建博客(知识库)需要做哪些工作?
|
||||
答:使用这个主题前需要你掌握下面这些知识:
|
||||
* 掌握 [markdown](https://xugaoyi.com/pages/ad247c4332211551/)、[yaml](https://xugaoyi.com/pages/4e8444e2d534d14f/) 语法
|
||||
* 会使用终端(命令行),会使用 git
|
||||
* 会阅读文档、搜索文档
|
||||
* 会[VuePress](https://vuepress.vuejs.org/zh/)的基本使用和默认主题的基本配置
|
||||
|
||||
以上知识都掌握之后,再查看本文档。你也可以运行我的主题项目,一边看代码,一边查看文档。主题项目内写了比较多的注释代码,方便你的学习和使用。
|
||||
|
||||
## clone 项目后需要修改哪些地方?
|
||||
答:大致的修改流程是这样的:
|
||||
1. 首先让项目正常的跑起来
|
||||
2. 根据需求构建和替换 [docs/<结构化目录>](/pages/2f674a/) 的目录及内容
|
||||
3. 根据需求修改 [config.js](/pages/a20ce8/) 配置
|
||||
4. 修改 [首页配置](/pages/f14bdb/)
|
||||
5. 修改 [主题颜色和样式](/pages/f51918/)(如果你想修改的话)
|
||||
|
||||
|
||||
## 可减少项目冗余的地方有哪些?
|
||||
答:在完成项目的搭建之后,对于没有使用到的一些文件和代码,可以看情况删减,可删减的地方有:
|
||||
* 卸载`config.js`中未使用的插件依赖包
|
||||
* 参照 [目录结构](/pages/2f674a/),删除未使用到的 `可选` 文件
|
||||
* 删除`.vusepress`目录内未使用到的 `可选` 文件
|
||||
* 删除各文件内的注释代码
|
||||
|
||||
## 我可以不使用永久链接吗?
|
||||
答:**不可以**。当你没有在front matter指定永久链接时,主题会[自动生成永久链接](/pages/088c16/)到front matter,你可以修改永久链接的值。
|
||||
使用永久链接是出于以下几点考虑:
|
||||
1. 在`config.js`配置nav时使用永久链接,就不会因为文件的路径或名称的改变而改变。
|
||||
2. 对于博客而言,当别人收藏了你的文章,在未来的时间里都可以通过永久链接来访问到。
|
||||
3. 主题中的`目录页`需要通过永久链接来访问文章。
|
||||
|
||||
## 是否支持国际化?
|
||||
答:暂不支持。目前的国际化方案,只能是使用不同项目来处理,比如:一个项目是中文,一个项目是英文,在导航中添加中英文站点的链接。
|
||||
|
||||
## 打包后在本地预览怎么没有样式?
|
||||
答:因vuepress打包后的CSS、JS等资源链接采用绝对路径引入,在本地预览时的引入链接是不正确的,部署到服务器即可正常引入和预览。如果你确实需要本地预览,可以使用[vuepress-plugin-serve](https://vuepress.github.io/zh/plugins/serve/)插件,使用方法看相应文档。
|
||||
|
||||
## 在`build`时出现错误,但是在`dev`时是正常的
|
||||
答:这种情况多半是因为你在`created`或`beforeCreate`生命周期调用了浏览器API的原因导致,详情查看:[浏览器的 API 访问限制](https://vuepress.vuejs.org/zh/guide/using-vue.html#%E6%B5%8F%E8%A7%88%E5%99%A8%E7%9A%84-api-%E8%AE%BF%E9%97%AE%E9%99%90%E5%88%B6)
|
||||
@@ -0,0 +1,45 @@
|
||||
---
|
||||
title: 如何贡献
|
||||
date: 2023-03-29 12:55:44
|
||||
permalink: /pages/69a632/
|
||||
---
|
||||
# 🎋代码分支说明
|
||||
- dev:常规开发分支,日常的开发、Bug修复、提交PR都在此分支
|
||||
- feature/xxx:特征分支,一些试验性开发、提交PR都在此分支,xxx可自行取一个有意义的名称
|
||||
- release/xxx:发行版分支,作为阶段性成果、重大更新的版本固化分支。受保护,不允许任何提交。
|
||||
- master:主分支,定期同步最新代码,目前仅支持本人(傲世孤尘/雨韵诗泽)提交。
|
||||
|
||||
|
||||
# ✊贡献的方式
|
||||
包括,但不限于以下形式:
|
||||
- 提交[issues](https://gitee.com/dromara/neutrino-proxy/issues)
|
||||
- 参与[issues](https://gitee.com/dromara/neutrino-proxy/issues)解决的必要性、解决方案的讨论、给出建设性的意见
|
||||
- 领取[issues](https://gitee.com/dromara/neutrino-proxy/issues) 并完成开发、提交PR
|
||||
- 为[本项目](https://gitee.com/dromara/neutrino-proxy)完善代码注释
|
||||
- 为[本项目](https://gitee.com/dromara/neutrino-proxy)增加测试代码
|
||||
- 为[本项目](https://gitee.com/dromara/neutrino-proxy)优化现有代码
|
||||
- 为[本项目](https://gitee.com/dromara/neutrino-proxy)优化操作体验
|
||||
- 通过公众号、博客、贴吧、论坛等形式分享/宣传中微子代理
|
||||
- 丰富项目文档,包括使用过程中踩过的坑、需要优化的点、具体问题的解决方法等
|
||||
|
||||
# 🧬贡献代码的步骤
|
||||
- 在Gitee或者Github上fork项目到自己的repo,fork,一定要把项目fork一份。
|
||||
- 把fork过去的项目也就是你的项目clone到你的本地
|
||||
- 同步feature/1.7.1最新代码
|
||||
- 修改代码
|
||||
- 开发完成后,不忙着提PR,再拉一遍最新代码,如果有冲突、解决冲突
|
||||
- commit后push到自己的库
|
||||
- 登录Gitee在你首页可以看到一个 pull request 按钮,点击它,填写一些说明信息,然后提交即可。
|
||||
- 等待维护者合并
|
||||
|
||||
# 📐PR的规范
|
||||
> 你可能发现有的代码并不符合这个规范,但我们后续都会朝着这个方向迈进。后续我们会逐步全面规范化,请先保证新提交的代码满足以下要求:
|
||||
|
||||
- 注释完备,尤其每个新增的方法应按照Java文档规范标明方法说明、参数说明、返回值说明等信息,必要时请添加单元测试,如果愿意,也可以加上你的大名。
|
||||
- 原则上,不允许自行添加第三方依赖库。若确有必要,请先和项目负责人沟通达成一致。
|
||||
- 对现有代码的优化,请在注释中说明原因。
|
||||
- 如果涉及到数据库的变更,则至少需要做到以下绩点:
|
||||
- sqlite、mysql下均测试通过
|
||||
- 在`./neutrino-proxy-server/src/main/resource/sql`下维护更新对应的表结构sql文件
|
||||
- 对于新增的表,维护必要的初始化数据
|
||||
- 在对应的mysql、sqlite的update目录下,维护SQL变更记录,确保SQL执行测试通过
|
||||
@@ -8,12 +8,15 @@ article: false
|
||||
|
||||
如果您正在使用这个项目并感觉良好,或者是想支持我继续开发,您可以通过如下`任意`方式支持我:
|
||||
|
||||
1. Star并分享 [vuepress-theme-vdoing](https://github.com/xugaoyi/vuepress-theme-vdoing) :rocket:
|
||||
1. Star并分享 [neutrino-proxy](https://gitee.com/dromara/neutrino-proxy) :rocket:
|
||||
谢谢! :heart:
|
||||
|
||||
<!--
|
||||
2. 轻轻点击一次上面的广告 :D
|
||||
2. 进入下面赞助商花十几秒钟扫码注册一下, 赞助商就会代您赞助一笔小钱。 :D
|
||||
3. 通过以下二维码 一次性捐款,打赏作者一杯茶。:tea:
|
||||
|
||||
谢谢! :heart:
|
||||
|
||||
|
||||
| 微信赞赏 | 微信 | 支付宝 |
|
||||
| :---: | :---: | :---: |
|
||||
@@ -22,7 +25,8 @@ article: false
|
||||
## 赞助商
|
||||
> 如果您想支持本项目,奈何囊中羞涩,您可以花十几秒点击下方赞助商进入注册(只需微信扫码就可以),赞助商就会代您赞助一笔小钱。
|
||||
|
||||
<!-- <a href="http://apifox.cn/a103xugaoyi" target="_blank"><img src="/img/Apifox-860x320.png" class="no-zoom" style="width: 400px;border-radius: 2px;"></a> -->
|
||||
|
||||
<a href="http://apifox.cn/a103xugaoyi" target="_blank"><img src="/img/Apifox-860x320.png" class="no-zoom" style="width: 400px;border-radius: 2px;"></a>
|
||||
<a href="http://apifox.cn/a103xugaoyi" target="_blank"><img src="https://cdn.staticaly.com/gh/xugaoyi/blog-gitalk-comment@master/img/431669861564_.2470ykdcpbds.jpg" class="no-zoom" style="border-radius: 2px;"></a>
|
||||
|
||||
|
||||
@@ -47,5 +51,6 @@ article: false
|
||||
|
||||
<img :src="$withBase('/img/qrcode/gzh.jpg')" style="width:180px;" />
|
||||
|
||||
-->
|
||||
## 致谢
|
||||
感谢给予支持的朋友,您的支持是我前进的动力 🎉
|
||||
|
||||
@@ -3,24 +3,30 @@ home: true
|
||||
|
||||
heroImage: /img/logo.png
|
||||
heroText: Neutrino-Proxy
|
||||
tagline: 🚀一个基于 netty 的、开源的 java 内网穿透项目
|
||||
tagline: 🚀一个基于Netty的开源内网穿透神器
|
||||
actionText: 开始使用 →
|
||||
actionLink: /pages/a2f161/
|
||||
actionLink: /pages/793dcb/
|
||||
bannerBg: none # auto => 网格纹背景(有bodyBgImg时无背景),默认 | none => 无 | '大图地址' | background: 自定义背景样式 提示:如发现文本颜色不适应你的背景时可以到palette.styl修改$bannerTextColor变量
|
||||
|
||||
features: # 可选的
|
||||
- title: 安全
|
||||
details: 内外网传输数据。
|
||||
- title: 快速
|
||||
details: 快速部署。
|
||||
- title: 穿透力强
|
||||
details: 穿透力。
|
||||
- title: 流量监控
|
||||
details: 首页图表、报表管理多维度流量监控。全方位掌握实时、历史代理数据。
|
||||
- title: 用户/License
|
||||
details: 支持多用户、多客户端使用。后台禁用实时生效。
|
||||
- title: 端口池
|
||||
details: 对外端口统一管理,支持用户、License独占端口。
|
||||
- title: 端口映射
|
||||
details: 新增、编辑、删除、禁用实时生效。
|
||||
- title: Docker
|
||||
details: 服务端支持Docker一键部署。
|
||||
- title: SSL证书
|
||||
details: 支持SSL,保护您的信息安全。
|
||||
|
||||
# 文章列表显示方式: detailed 默认,显示详细版文章列表(包括作者、分类、标签、摘要、分页等)| simple => 显示简约版文章列表(仅标题和日期)| none 不显示文章列表
|
||||
postList: none
|
||||
---
|
||||
<p align="center">
|
||||
<a class="become-sponsor" href="/pages/1b12ed/">支持这个项目</a>
|
||||
<a class="become-sponsor" href="https://gitee.com/dromara/neutrino-proxy">支持这个项目</a>
|
||||
</p>
|
||||
|
||||
<style>
|
||||
@@ -36,9 +42,7 @@ postList: none
|
||||
|
||||
<br/>
|
||||
<p align="center">
|
||||
<a href="https://www.npmjs.com/package/vuepress-theme-vdoing" target="_blank"><img src="https://img.shields.io/npm/v/vuepress-theme-vdoing" alt="npm" class="no-zoom"></a>
|
||||
<a href="https://www.npmjs.com/package/vuepress-theme-vdoing" target="_blank"><img src="https://img.shields.io/npm/dt/vuepress-theme-vdoing" alt="npm" class="no-zoom"></a>
|
||||
<a href="https://gitee.com/dromara/neutrino-proxy" target="_blank"><img src='https://gitee.com/dromara/neutrino-proxy/badge/star.svg?theme=dark' alt='star' class="no-zoom"></img></a>
|
||||
<a href="https://gitee.com/dromara/neutrino-proxy" target="_blank"><img src='https://gitee.com/dromara/neutrino-proxy/badge/star.svg?theme=dark' alt='star' class="no-zoom"></a>
|
||||
<a href="https://gitee.com/dromara/neutrino-proxy" target="_blank"><img src='https://gitee.com/dromara/neutrino-proxy/badge/fork.svg?theme=dark' alt='forks' class="no-zoom"></a>
|
||||
</p>
|
||||
|
||||
@@ -79,7 +83,7 @@ postList: none
|
||||
:::
|
||||
-->
|
||||
<br/>
|
||||
|
||||
<!--
|
||||
## 🎉上新推荐
|
||||
* `v1.7.0`:项目重构、底层框架更换为Solon。
|
||||
* `v1.6.4`:代理使用细节优化。
|
||||
@@ -93,6 +97,7 @@ postList: none
|
||||
更多上新请查阅:[**更新日志**](https://gitee.com/dromara/neutrino-proxy/releases)
|
||||
|
||||
<br/>
|
||||
-->
|
||||
|
||||
<!-- ## ⚡️未来...
|
||||
* `v1.5.0`:新增配置文件对TypeScript的支持,参考[config.ts](https://github.com/xugaoyi/vuepress-theme-vdoing/blob/master/docs/.vuepress/config.ts)。新增[标题标记](/pages/3216b0/#titletag)。
|
||||
@@ -143,17 +148,7 @@ postList: none
|
||||
</table>
|
||||
<br/>
|
||||
|
||||
## 🏗️添砖加瓦
|
||||
|
||||
### 🎋分支说明
|
||||
|
||||
neutrino-proxy主要的源码分为两个分支,功能如下:
|
||||
|
||||
| 分支 | 作用 |
|
||||
|---|---------------------------------------------------------------|
|
||||
| master | 主分支,不接收任何pr或修改 |
|
||||
| feature/1.7.1 | 开发分支,默认为下个版本的SNAPSHOT版本,接受修改或pr |
|
||||
|
||||
<!--
|
||||
### 🐞提供bug反馈或建议
|
||||
|
||||
提交问题反馈请说明正在使用环境以及相关问题
|
||||
@@ -162,102 +157,134 @@ neutrino-proxy主要的源码分为两个分支,功能如下:
|
||||
|
||||
[//]: # (- [Github issue](https://github.com/dromara/hutool/issues))
|
||||
|
||||
|
||||
### 🧬贡献代码的步骤
|
||||
|
||||
贡献代码注意事项:
|
||||
1. 在Gitee或者Github上fork项目到自己的repo,fork,一定要把项目fork一份。
|
||||
2. 把fork过去的项目也就是你的项目clone到你的本地
|
||||
3. 同步feature/1.7.1最新代码
|
||||
4. 修改代码
|
||||
5. 开发完成后,不忙着提PR,再拉一遍最新代码,如果有冲突、解决冲突
|
||||
6. commit后push到自己的库
|
||||
7. 登录Gitee在你首页可以看到一个 pull request 按钮,点击它,填写一些说明信息,然后提交即可。
|
||||
8. 等待维护者合并
|
||||
|
||||
<br/>
|
||||
-->
|
||||
|
||||
## 📚 Dromara 成员项目
|
||||
<p align="center">
|
||||
<a href="https://gitee.com/dromara/TLog" target="_blank">
|
||||
<img src="https://oss.dev33.cn/sa-token/link/tlog2.png" alt="一个轻量级的分布式日志标记追踪神器,10分钟即可接入,自动对日志打标签完成微服务的链路追踪" width="15%">
|
||||
<h2 id="🤝-dromara-组织项目"><a href="#🤝-dromara-组织项目" class="header-anchor">#</a> 🤝 dromara 组织项目</h2>
|
||||
<p align="center"><b><a href="https://dromara.org/zh/projects/" target="_blank">为往圣继绝学,一个人或许能走的更快,但一群人会走的更远。</a></b></p>
|
||||
<p>
|
||||
<a href="https://gitee.com/dromara/TLog" target="_blank" class="friends-item">
|
||||
<img class="no-zoom friends-item-img hover-alt" src="https://oss.dev33.cn/sa-token/link/tlog.png" msg="一个轻量级的分布式日志标记追踪神器,10分钟即可接入,自动对日志打标签完成微服务的链路追踪">
|
||||
</a>
|
||||
<a href="https://gitee.com/dromara/liteFlow" target="_blank">
|
||||
<img src="https://oss.dev33.cn/sa-token/link/liteflow.png" alt="轻量,快速,稳定,可编排的组件式流程引擎" width="15%">
|
||||
<a href="https://gitee.com/dromara/liteFlow" target="_blank" class="friends-item">
|
||||
<img class="no-zoom friends-item-img hover-alt" src="https://oss.dev33.cn/sa-token/link/liteflow.png" msg="轻量,快速,稳定,可编排的组件式流程引擎">
|
||||
</a>
|
||||
<a href="https://hutool.cn/" target="_blank">
|
||||
<img src="https://oss.dev33.cn/sa-token/link/hutool.jpg" alt="小而全的Java工具类库,使Java拥有函数式语言般的优雅,让Java语言也可以“甜甜的”。" width="15%">
|
||||
<a href="https://hutool.cn/" target="_blank" class="friends-item">
|
||||
<img class="no-zoom friends-item-img hover-alt" src="https://oss.dev33.cn/sa-token/link/hutool.jpg" msg="🍬小而全的Java工具类库,使Java拥有函数式语言般的优雅,让Java语言也可以“甜甜的”。">
|
||||
</a>
|
||||
<a href="https://sa-token.dev33.cn/" target="_blank">
|
||||
<img src="https://oss.dev33.cn/sa-token/link/sa-token.png" alt="一个轻量级 java 权限认证框架,让鉴权变得简单、优雅!" width="15%">
|
||||
<a href="https://sa-token.cc/" target="_blank" class="friends-item">
|
||||
<img class="no-zoom friends-item-img hover-alt" src="https://oss.dev33.cn/sa-token/link/sa-token.png" msg="一个轻量级 java 权限认证框架,让鉴权变得简单、优雅!">
|
||||
</a>
|
||||
<a href="https://gitee.com/dromara/hmily" target="_blank">
|
||||
<img src="https://oss.dev33.cn/sa-token/link/hmily.png" alt="高性能一站式分布式事务解决方案。" width="15%">
|
||||
<a href="https://gitee.com/dromara/hmily" target="_blank" class="friends-item">
|
||||
<img class="no-zoom friends-item-img hover-alt" src="https://oss.dev33.cn/sa-token/link/hmily.png" msg="高性能一站式分布式事务解决方案。">
|
||||
</a>
|
||||
<a href="https://gitee.com/dromara/Raincat" target="_blank">
|
||||
<img src="https://oss.dev33.cn/sa-token/link/raincat.png" alt="强一致性分布式事务解决方案。" width="15%">
|
||||
</a>
|
||||
</p>
|
||||
<p align="center">
|
||||
<a href="https://gitee.com/dromara/myth" target="_blank">
|
||||
<img src="https://oss.dev33.cn/sa-token/link/myth.png" alt="可靠消息分布式事务解决方案。" width="15%">
|
||||
</a>
|
||||
<a href="https://cubic.jiagoujishu.com/" target="_blank">
|
||||
<img src="https://oss.dev33.cn/sa-token/link/cubic.png" alt="一站式问题定位平台,以agent的方式无侵入接入应用,完整集成arthas功能模块,致力于应用级监控,帮助开发人员快速定位问题" width="15%">
|
||||
</a>
|
||||
<a href="https://maxkey.top/" target="_blank">
|
||||
<img src="https://oss.dev33.cn/sa-token/link/maxkey.png" alt="业界领先的身份管理和认证产品" width="15%">
|
||||
</a>
|
||||
<a href="http://forest.dtflyx.com/" target="_blank">
|
||||
<img src="https://oss.dev33.cn/sa-token/link/forest-logo.png" alt="Forest能够帮助您使用更简单的方式编写Java的HTTP客户端" width="15%">
|
||||
</a>
|
||||
<a href="https://jpom.io/" target="_blank">
|
||||
<img src="https://oss.dev33.cn/sa-token/link/jpom.png" alt="一款简而轻的低侵入式在线构建、自动部署、日常运维、项目监控软件" width="15%">
|
||||
</a>
|
||||
<a href="https://su.usthe.com/" target="_blank">
|
||||
<img src="https://oss.dev33.cn/sa-token/link/sureness.png" alt="面向 REST API 的高性能认证鉴权框架" width="15%">
|
||||
</a>
|
||||
</p>
|
||||
<p align="center">
|
||||
<a href="https://easy-es.cn/" target="_blank">
|
||||
<img src="https://oss.dev33.cn/sa-token/link/easy-es2.png" alt="傻瓜级ElasticSearch搜索引擎ORM框架" width="15%">
|
||||
</a>
|
||||
<a href="https://gitee.com/dromara/northstar" target="_blank">
|
||||
<img src="https://oss.dev33.cn/sa-token/link/northstar_logo.png" alt="Northstar盈富量化交易平台" width="15%">
|
||||
</a>
|
||||
<a href="https://hertzbeat.com/" target="_blank">
|
||||
<img src="https://oss.dev33.cn/sa-token/link/hertzbeat_brand.jpg" alt="易用友好的云监控系统" width="15%">
|
||||
</a>
|
||||
<a href="https://plugins.sheng90.wang/fast-request/" target="_blank">
|
||||
<img src="https://oss.dev33.cn/sa-token/link/fast-request.gif" alt="Idea 版 Postman,为简化调试API而生" width="15%">
|
||||
</a>
|
||||
<a href="https://www.jeesuite.com/" target="_blank">
|
||||
<img src="https://oss.dev33.cn/sa-token/link/mendmix.png" alt="开源分布式云原生架构一站式解决方案" width="15%">
|
||||
</a>
|
||||
<a href="https://gitee.com/dromara/koalas-rpc" target="_blank">
|
||||
<img src="https://oss.dev33.cn/sa-token/link/koalas-rpc2.png" alt="企业生产级百亿日PV高可用可拓展的RPC框架。" width="15%">
|
||||
</a>
|
||||
</p>
|
||||
<p align="center">
|
||||
<a href="https://async.sizegang.cn/" target="_blank">
|
||||
<img src="https://oss.dev33.cn/sa-token/link/gobrs-async.png" alt="配置极简功能强大的异步任务动态编排框架" width="15%">
|
||||
</a>
|
||||
<a href="https://dynamictp.cn/" target="_blank">
|
||||
<img src="https://oss.dev33.cn/sa-token/link/dynamic-tp.png" alt="基于配置中心的轻量级动态可监控线程池" width="15%">
|
||||
</a>
|
||||
<a href="https://www.x-easypdf.cn" target="_blank">
|
||||
<img src="https://oss.dev33.cn/sa-token/link/x-easypdf.png" alt="一个用搭积木的方式构建pdf的框架(基于pdfbox)" width="15%">
|
||||
</a>
|
||||
<a href="http://dromara.gitee.io/image-combiner" target="_blank">
|
||||
<img src="https://oss.dev33.cn/sa-token/link/image-combiner.png" alt="一个专门用于图片合成的工具,没有很复杂的功能,简单实用,却不失强大" width="15%">
|
||||
</a>
|
||||
<a href="https://www.herodotus.cn/" target="_blank">
|
||||
<img src="https://oss.dev33.cn/sa-token/link/dante-cloud2.png" alt="Dante-Cloud 是一款企业级微服务架构和服务能力开发平台。" width="15%">
|
||||
</a>
|
||||
<a href="https://dromara.org/zh/projects/" target="_blank">
|
||||
<img src="https://oss.dev33.cn/sa-token/link/dromara.png" alt="让每一位开源爱好者,体会到开源的快乐。" width="15%">
|
||||
<a href="https://gitee.com/dromara/Raincat" target="_blank" class="friends-item">
|
||||
<img class="no-zoom friends-item-img hover-alt" src="https://oss.dev33.cn/sa-token/link/raincat.png" msg="强一致性分布式事务解决方案。">
|
||||
</a>
|
||||
<a href="https://gitee.com/dromara/myth" target="_blank" class="friends-item">
|
||||
<img class="no-zoom friends-item-img hover-alt" src="https://oss.dev33.cn/sa-token/link/myth.png" msg="可靠消息分布式事务解决方案。">
|
||||
</a>
|
||||
<a href="https://cubic.jiagoujishu.com/" target="_blank" class="friends-item">
|
||||
<img class="no-zoom friends-item-img hover-alt" src="https://oss.dev33.cn/sa-token/link/cubic.png" msg="一站式问题定位平台,以agent的方式无侵入接入应用,完整集成arthas功能模块,致力于应用级监控,帮助开发人员快速定位问题">
|
||||
</a>
|
||||
<a href="https://maxkey.top/" target="_blank" class="friends-item">
|
||||
<img class="no-zoom friends-item-img hover-alt" src="https://oss.dev33.cn/sa-token/link/maxkey.png" msg="业界领先的身份管理和认证产品">
|
||||
</a>
|
||||
<a href="http://forest.dtflyx.com/" target="_blank" class="friends-item">
|
||||
<img class="no-zoom friends-item-img hover-alt" src="https://oss.dev33.cn/sa-token/link/forest-logo.png" msg="Forest能够帮助您使用更简单的方式编写Java的HTTP客户端" nf="">
|
||||
</a>
|
||||
<a href="https://jpom.top/" target="_blank" class="friends-item">
|
||||
<img class="no-zoom friends-item-img hover-alt" src="https://oss.dev33.cn/sa-token/link/jpom.png" msg="一款简而轻的低侵入式在线构建、自动部署、日常运维、项目监控软件">
|
||||
</a>
|
||||
<a href="https://su.usthe.com/" target="_blank" class="friends-item">
|
||||
<img class="no-zoom friends-item-img hover-alt" src="https://oss.dev33.cn/sa-token/link/sureness.png" msg="面向 REST API 的高性能认证鉴权框架">
|
||||
</a>
|
||||
<a href="https://easy-es.cn/" target="_blank" class="friends-item">
|
||||
<img class="no-zoom friends-item-img hover-alt" src="https://oss.dev33.cn/sa-token/link/easy-es2.png" msg="🚀傻瓜级ElasticSearch搜索引擎ORM框架">
|
||||
</a>
|
||||
<a href="https://gitee.com/dromara/northstar" target="_blank" class="friends-item">
|
||||
<img class="no-zoom friends-item-img hover-alt" src="https://oss.dev33.cn/sa-token/link/northstar_logo.png" msg="Northstar盈富量化交易平台">
|
||||
</a>
|
||||
<a href="https://hertzbeat.com/" target="_blank" class="friends-item">
|
||||
<img class="no-zoom friends-item-img hover-alt" src="https://oss.dev33.cn/sa-token/link/hertzbeat-brand.svg" msg="易用友好的云监控系统">
|
||||
</a>
|
||||
<a href="https://dromara.gitee.io/fast-request/" target="_blank" class="friends-item">
|
||||
<img class="no-zoom friends-item-img hover-alt" src="https://oss.dev33.cn/sa-token/link/fast-request.gif" msg="Idea 版 Postman,为简化调试API而生">
|
||||
</a>
|
||||
<a href="https://www.jeesuite.com/" target="_blank" class="friends-item">
|
||||
<img class="no-zoom friends-item-img hover-alt" src="https://oss.dev33.cn/sa-token/link/mendmix.png" msg="开源分布式云原生架构一站式解决方案">
|
||||
</a>
|
||||
<a href="https://gitee.com/dromara/koalas-rpc" target="_blank" class="friends-item">
|
||||
<img class="no-zoom friends-item-img hover-alt" src="https://oss.dev33.cn/sa-token/link/koalas-rpc2.png" msg="企业生产级百亿日PV高可用可拓展的RPC框架。">
|
||||
</a>
|
||||
<a href="https://async.sizegang.cn/" target="_blank" class="friends-item">
|
||||
<img class="no-zoom friends-item-img hover-alt" src="https://oss.dev33.cn/sa-token/link/gobrs-async.png" msg="🔥 配置极简功能强大的异步任务动态编排框架">
|
||||
</a>
|
||||
<a href="https://dynamictp.cn/" target="_blank" class="friends-item">
|
||||
<img class="no-zoom friends-item-img hover-alt" src="https://oss.dev33.cn/sa-token/link/dynamic-tp.png" msg="🔥🔥🔥 基于配置中心的轻量级动态可监控线程池">
|
||||
</a>
|
||||
<a href="https://www.x-easypdf.cn" target="_blank" class="friends-item">
|
||||
<img class="no-zoom friends-item-img hover-alt" src="https://oss.dev33.cn/sa-token/link/x-easypdf.png" msg="一个用搭积木的方式构建pdf的框架(基于pdfbox)">
|
||||
</a>
|
||||
<a href="http://dromara.gitee.io/image-combiner" target="_blank" class="friends-item">
|
||||
<img class="no-zoom friends-item-img hover-alt" src="https://oss.dev33.cn/sa-token/link/image-combiner.png" msg="一个专门用于图片合成的工具,没有很复杂的功能,简单实用,却不失强大">
|
||||
</a>
|
||||
<a href="https://www.herodotus.cn/" target="_blank" class="friends-item">
|
||||
<img class="no-zoom friends-item-img hover-alt" src="https://oss.dev33.cn/sa-token/link/dante-cloud2.png" msg="Dante-Cloud 是一款企业级微服务架构和服务能力开发平台。">
|
||||
</a>
|
||||
<a href="http://www.mtruning.club" target="_blank" class="friends-item">
|
||||
<img class="no-zoom friends-item-img hover-alt" src="https://oss.dev33.cn/sa-token/link/go-view.png" msg="低代码数据可视化开发平台">
|
||||
</a>
|
||||
<a href="https://tangyh.top/" target="_blank" class="friends-item">
|
||||
<img class="no-zoom friends-item-img hover-alt" src="https://oss.dev33.cn/sa-token/link/lamp-cloud.png" msg="微服务中后台快速开发平台,支持租户(SaaS)模式、非租户模式">
|
||||
</a>
|
||||
<a href="https://www.redisfront.com/" target="_blank" class="friends-item">
|
||||
<img class="no-zoom friends-item-img hover-alt" src="https://oss.dev33.cn/sa-token/link/redis-front.png" msg="RedisFront 是一款开源免费的跨平台 Redis 桌面客户端工具, 支持单机模式, 集群模式, 哨兵模式以及 SSH 隧道连接, 可轻松管理Redis缓存数据.">
|
||||
</a>
|
||||
<a href="https://www.yuque.com/u34495/mivcfg" target="_blank" class="friends-item">
|
||||
<img class="no-zoom friends-item-img hover-alt" src="https://oss.dev33.cn/sa-token/link/electron-egg.png" msg="一个入门简单、跨平台、企业级桌面软件开发框架">
|
||||
</a>
|
||||
<a href="https://gitee.com/dromara/open-capacity-platform" target="_blank" class="friends-item">
|
||||
<img class="no-zoom friends-item-img hover-alt" src="https://oss.dev33.cn/sa-token/link/open-capacity-platform.jpg" msg="简称ocp是基于Spring Cloud的企业级微服务框架(用户权限管理,配置中心管理,应用管理,....)">
|
||||
</a>
|
||||
<a href="http://easy-trans.fhs-opensource.top/" target="_blank" class="friends-item">
|
||||
<img class="no-zoom friends-item-img hover-alt" src="https://oss.dev33.cn/sa-token/link/easy_trans.png" msg="Easy-Trans 一个注解搞定数据翻译,减少30%SQL代码量">
|
||||
</a>
|
||||
<a href="https://gitee.com/dromara/neutrino-proxy" target="_blank" class="friends-item">
|
||||
<img class="no-zoom friends-item-img hover-alt" src="https://oss.dev33.cn/sa-token/link/neutrino-proxy.svg" msg="一款基于 Netty 的、开源的内网穿透神器。">
|
||||
</a>
|
||||
<a href="https://chatgpt.cn.obiscr.com/" target="_blank" class="friends-item">
|
||||
<img class="no-zoom friends-item-img hover-alt" src="https://oss.dev33.cn/sa-token/link/chatgpt.png" msg="一个支持在 JetBrains 系列 IDE 上运行的 ChatGPT 的插件。">
|
||||
</a>
|
||||
<a href="https://gitee.com/dromara/zyplayer-doc" target="_blank" class="friends-item">
|
||||
<img class="no-zoom friends-item-img hover-alt" src="https://oss.dev33.cn/sa-token/link/zyplayer-doc.png" msg="zyplayer-doc是一款适合团队和个人使用的WIKI文档管理工具,同时还包含数据库文档、Api接口文档。">
|
||||
</a>
|
||||
<a href="https://gitee.com/dromara/payment-spring-boot" target="_blank" class="friends-item">
|
||||
<img class="no-zoom friends-item-img hover-alt" src="https://oss.dev33.cn/sa-token/link/payment-spring-boot.png" msg="最全最好用的微信支付V3 Spring Boot 组件。">
|
||||
</a>
|
||||
<a href="https://www.j2eefast.com/" target="_blank" class="friends-item">
|
||||
<img class="no-zoom friends-item-img hover-alt" src="https://oss.dev33.cn/sa-token/link/j2eefast.png" msg="J2eeFAST 是一个致力于中小企业 Java EE 企业级快速开发平台,我们永久开源!">
|
||||
</a>
|
||||
<a href="https://gitee.com/dromara/data-compare" target="_blank" class="friends-item">
|
||||
<img class="no-zoom friends-item-img hover-alt" src="https://oss.dev33.cn/sa-token/link/dataCompare.png" msg="数据库比对工具:hive 表数据比对,mysql、Doris 数据比对,实现自动化配置进行数据比对,避免频繁写sql 进行处理,低代码(Low-Code) 平台">
|
||||
</a>
|
||||
<a href="https://gitee.com/dromara/open-giteye-api" target="_blank" class="friends-item">
|
||||
<img class="no-zoom friends-item-img hover-alt" src="https://oss.dev33.cn/sa-token/link/open-giteye-api.svg" msg="giteye.net 是专为开源作者设计的数据图表服务工具类站点,提供了包括 Star 趋势图、贡献者列表、Gitee指数等数据图表服务。">
|
||||
</a>
|
||||
<a href="https://gitee.com/dromara/RuoYi-Vue-Plus" target="_blank" class="friends-item">
|
||||
<img class="no-zoom friends-item-img hover-alt" src="https://oss.dev33.cn/sa-token/link/RuoYi-Vue-Plus.png" msg="后台管理系统 重写 RuoYi-Vue 所有功能 集成 Sa-Token + Mybatis-Plus + Jackson + Xxl-Job + SpringDoc + Hutool + OSS 定期同步">
|
||||
</a>
|
||||
<a href="https://gitee.com/dromara/RuoYi-Cloud-Plus" target="_blank" class="friends-item">
|
||||
<img class="no-zoom friends-item-img hover-alt" src="https://oss.dev33.cn/sa-token/link/RuoYi-Cloud-Plus.png" msg="微服务管理系统 重写RuoYi-Cloud所有功能 整合 SpringCloudAlibaba Dubbo3.0 Sa-Token Mybatis-Plus MQ OSS ES Xxl-Job Docker 全方位升级 定期同步">
|
||||
</a>
|
||||
<a href="https://gitee.com/dromara/stream-query" target="_blank" class="friends-item">
|
||||
<img class="no-zoom friends-item-img hover-alt" src="https://oss.dev33.cn/sa-token/link/stream-query.png" msg="允许完全摆脱 Mapper 的 mybatis-plus 体验!封装 stream 和 lambda 操作进行数据返回处理。">
|
||||
</a>
|
||||
<a href="https://dromara.org/zh/projects/" target="_blank" class="friends-item">
|
||||
<img class="no-zoom friends-item-img hover-alt" src="https://oss.dev33.cn/sa-token/link/dromara.png" msg="让每一位开源爱好者,体会到开源的快乐。">
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<!-- AD -->
|
||||
<div class="wwads-cn wwads-horizontal page-wwads" data-id="136"></div>
|
||||
<style>
|
||||
@@ -280,4 +307,32 @@ neutrino-proxy主要的源码分为两个分支,功能如下:
|
||||
padding-top: 5px;
|
||||
display: block;
|
||||
}
|
||||
.friends-item {
|
||||
width: 10em;
|
||||
height: 3em;
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
display: inline-block;
|
||||
margin: 5px;
|
||||
border: 2px solid #ebeef5;
|
||||
box-shadow: 0 2px 12px 0 rgba(0,0,0,.1);
|
||||
border-radius: 8px;
|
||||
padding: 10px
|
||||
}
|
||||
.friends-item-img {
|
||||
-o-object-fit: contain;
|
||||
object-fit: contain;
|
||||
max-width: 150px!important;
|
||||
height: 100%
|
||||
}
|
||||
/*a {*/
|
||||
/* font-weight: 500;*/
|
||||
/* text-decoration: none*/
|
||||
/*}*/
|
||||
/*a,p a code {*/
|
||||
/*color: #4274f4*/
|
||||
/*}*/
|
||||
/*p a code {*/
|
||||
/*font-weight: 400*/
|
||||
/*}*/
|
||||
</style>
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"scripts": {
|
||||
"dev": "vuepress dev docs",
|
||||
"build": "vuepress build docs",
|
||||
"buildAndDeploy": "vuepress build docs && bash deploy.sh",
|
||||
"deploy": "bash deploy.sh",
|
||||
"updateTheme": "yarn remove vuepress-theme-vdoing && rm -rf node_modules && yarn && yarn add vuepress-theme-vdoing -D",
|
||||
"editFm": "node utils/editFrontmatter.js"
|
||||
|
||||
@@ -7,12 +7,12 @@
|
||||
<parent>
|
||||
<groupId>org.noear</groupId>
|
||||
<artifactId>solon-parent</artifactId>
|
||||
<version>2.2.2</version>
|
||||
<version>2.2.8</version>
|
||||
<relativePath />
|
||||
</parent>
|
||||
|
||||
<groupId>fun.asgc.neutrino</groupId>
|
||||
<artifactId>neutrino-proxy</artifactId>
|
||||
<groupId>org.dromara.neutrino-proxy</groupId>
|
||||
<artifactId>neutrino-proxy-parent</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>${revision}</version>
|
||||
|
||||
|
||||