Compare commits

..
33 Commits
Author SHA1 Message Date
aoshiguchen 612fad1f86 Delete .github/workflows/t1.yml 2025-05-25 11:12:57 +08:00
aoshiguchen 9d1db6acbd Create t1.yml 2025-05-25 10:32:54 +08:00
aoshiguchen a8823297e9 Delete .github/workflows/t1.yml 2025-05-25 10:31:49 +08:00
aoshiguchen 20a776782f Create t1.yml 2025-05-25 10:29:59 +08:00
aoshiguchen a7ee52dbf1 升级版本为2.0.3 2025-05-24 21:53:54 +08:00
aoshiguchen 95764cdfb0 workflow 2025-05-24 21:04:37 +08:00
aoshiguchen 22ff47dbe6 workflow. 2025-05-24 20:58:24 +08:00
aoshiguchen 391d664710 workflow. 2025-05-24 20:54:47 +08:00
aoshiguchen f26ed2d12e workflow.. 2025-05-24 20:48:07 +08:00
aoshiguchen aa02b7b3c2 workflow 2025-05-24 20:43:21 +08:00
aoshiguchen 344bf11b88 workflow. 2025-05-24 20:40:23 +08:00
aoshiguchen f9ab82cd80 workflow 2025-05-24 20:33:11 +08:00
aoshiguchen e97aacee8f workflow. 2025-05-24 20:17:43 +08:00
aoshiguchen 59acada928 workflow 2025-05-24 20:12:27 +08:00
aoshiguchen 498ffeed46 更新打包脚本 2025-05-24 20:08:28 +08:00
aoshiguchen 0164e71f37 解决http请求拆包情况下域名映射失效的问题 2025-05-24 18:53:54 +08:00
aoshiguchen 65abda93fb 更新配置,解决docker部署时无法通过环境变量指定db配置的问题 2025-03-06 13:04:08 +08:00
傲世孤尘 9c818e5fcf !66 修复【License流量报表】 SQL报错
Merge pull request !66 from 晚安,地球/master-fix-License流量报表SQL报错
2025-01-06 05:48:41 +00:00
baiyun_xuyan a8c05a9e5e fix:gitee@ issues/IBD933 【License流量报表】 SQL报错 2024-12-26 00:34:50 +08:00
aoshiguchen 01ac42f269 官网里程碑更新 2024-12-23 17:00:26 +08:00
aoshiguchen d4f77524cf 官网新增通过宝塔面板部署说明 2024-12-20 16:48:22 +08:00
aoshiguchen d22b8df0ac 测试. 2024-12-19 10:24:52 +08:00
aoshiguchen c96d91c17c 测试.. 2024-12-19 10:23:22 +08:00
aoshiguchen af9cf5d260 Merge branch 'master' into dev 2024-12-19 10:12:03 +08:00
aoshiguchen 6eb31879ab 测试。 2024-12-19 10:11:37 +08:00
aoshiguchen 8cf89e86d5 更新官网. 2024-12-18 22:17:28 +08:00
aoshiguchen 43aec0d8de Merge branch 'dev'
# Conflicts:
#	neutrino-proxy-vuepress/docs/01.使用教程/01.安装部署/01.快速上手.md
2024-12-18 22:10:00 +08:00
aoshiguchen d343231351 更新官网 2024-12-18 22:09:38 +08:00
aoshiguchen 83519299f8 Merge branch 'dev' 2024-12-18 22:09:02 +08:00
aoshiguchen 87c2ff846a 更新官网 2024-12-18 22:08:43 +08:00
aoshiguchen 02af8df384 更新官网. 2024-12-18 21:48:46 +08:00
aoshiguchen 81d8a41842 更新官网.. 2024-12-18 21:47:06 +08:00
aoshiguchen f2999fa384 更新官网. 2024-12-18 21:42:53 +08:00
27 changed files with 113 additions and 42 deletions
+3 -3
View File
@@ -13,7 +13,7 @@ jobs:
matrix:
# see: https://docs.github.com/zh/actions/using-jobs/choosing-the-runner-for-a-job
# os: ['ubuntu-20.04', 'macos-12']
os: ['ubuntu-20.04']
os: ['ubuntu-latest']
name: build - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
# https://github.com/softprops/action-gh-release/issues/236#issuecomment-1150530128
@@ -39,7 +39,7 @@ jobs:
distribution: 'graalvm' # New 'distribution' option
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Cache local Maven repository
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
@@ -84,7 +84,7 @@ jobs:
filename: neutrino-proxy-client-${{ env.OS }}-${{ env.VERSION }}-native.zip
# 上传构建产物
- name: Upload artifact
uses: actions/upload-artifact@v3.0.0
uses: actions/upload-artifact@v4.3.1
with:
name: neutrino-proxy-server-client-${{ env.OS }}-${{ env.VERSION }}
path: |
+2 -2
View File
@@ -38,7 +38,7 @@ jobs:
distribution: 'graalvm' # New 'distribution' option
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Cache local Maven repository
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
@@ -83,7 +83,7 @@ jobs:
filename: neutrino-proxy-client-${{ env.OS }}-${{ env.VERSION }}-native.zip
# 上传构建产物
- name: Upload artifact
uses: actions/upload-artifact@v3.0.0
uses: actions/upload-artifact@v4.3.1
with:
name: neutrino-proxy-server-client-${{ env.OS }}-${{ env.VERSION }}
path: |
+3 -10
View File
@@ -40,20 +40,12 @@ stages:
- '# 执行编译命令'
- npm install && npm run build
- ''
- '# 资源复制,使得官网访问支持直接域名访问 + 域名后面带路径 2种访问方式'
- cp ./CNAME docs/.vuepress/dist/
- rm -rf docs/.vuepress/dist/neutrino-proxy
- rm -rf docs/.vuepress/distTemp
- cp -rf docs/.vuepress/dist/ docs/.vuepress/distTemp
- cp -rf docs/.vuepress/distTemp docs/.vuepress/dist/neutrino-proxy
- rm -rf docs/.vuepress/distTemp
- ''
- '# 初始化git仓库'
- cd docs/.vuepress/dist
- git init
- ''
- '# 设置Git信息'
- GIT_REPO_URL=https://gitee.com/dromara/neutrino-proxy.git
- GIT_REPO_URL=$repo_url
- GIT_USERNAME=$username
- GIT_NAME=$commit_name
- GIT_EMAIL=$commit_email
@@ -66,7 +58,8 @@ stages:
- ''
- '# 将构建产物推送到目标分支'
- git add -A
- git commit -m $GITEE_COMMIT_MESSAGE
- '# git commit -m $GITEE_COMMIT_MESSAGE'
- git commit -m "update"
- git checkout -b $target_branch
- git push -f origin $target_branch
artifacts:
+11 -6
View File
@@ -17,8 +17,6 @@
- 技术栈:Solon、MybatisPlus、Netty
- 遵循MIT许可,因此您可以对它进行复制、修改、传播并用于任何个人或商业行为。
- 官网地址1https://neutrino-proxy.dromara.org
- ~~官网地址2https://dromara.gitee.io/neutrino-proxy~~
- ~~官网地址3https://neutrino-proxy-docs.asgc.fun~~
- 快速上手请[点击这里](https://neutrino-proxy.dromara.org/neutrino-proxy/pages/793dcb/)
# 2、名称由来
@@ -28,23 +26,30 @@
因此以中微子命名,寓意着中微子代理拥有中微子"安全"、"快速"、"穿透力强"的特点。
# 3、运行示例
# 3、部署方式
- 1、[使用宝塔面板](https://neutrino-proxy.dromara.org/pages/9e0fde/)
- 2、[使用jar文件](https://neutrino-proxy.dromara.org/pages/eebea1/)
- 3、[使用Docker](https://neutrino-proxy.dromara.org/pages/5b9bef/)
- 4、[原生部署](https://neutrino-proxy.dromara.org/pages/69699a/)
- 5、[使用Docker-Compose](https://neutrino-proxy.dromara.org/pages/2d4123/)
# 4、运行示例
![首页](assets/run-example/home.png)
![用户管理](assets/run-example/user-manager1.png)
![端口池管理](assets/run-example/port-pool1.png)
![License管理](assets/run-example/license1.png)
![端口映射管理](assets/run-example/port-mapping1.png)
# 4、代理示意图
# 5、代理示意图
![代理流程](assets/design/neutrino-proxy-process.jpg)
# 5、联系我们
# 6、联系我们
- 微信: yuyunshize
- GitCodehttps://gitcode.com/dromara/neutrino-proxy
- Gitee: https://gitee.com/asgc/neutrino-proxy
- Github仓库:https://github.com/dromara/neutrino-proxy
# 6、贡献者列表
# 7、贡献者列表
<p>
<a href="https://gitee.com/zcans" target="_blank">
<img src="assets/developer/zcans.png" width="11%">
+2
View File
@@ -92,3 +92,5 @@
- [x] 支持维护https证书
- 端口映射支持支持绑定多个子域名
- 选择择不同的主域名、子域名变更实时生效
## 2.0.3
- 解决http请求拆包情况下域名映射失效的问题
@@ -1,10 +1,13 @@
package org.dromara.neutrinoproxy.server.proxy.security;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import io.netty.util.CharsetUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.checkerframework.checker.i18nformatter.qual.I18nFormat;
import org.dromara.neutrinoproxy.core.Constants;
import org.dromara.neutrinoproxy.core.util.HttpUtil;
import org.dromara.neutrinoproxy.core.util.IpUtil;
@@ -28,18 +31,35 @@ public class HttpVisitorSecurityChannelHandler extends ChannelInboundHandlerAdap
*/
private Boolean isHttps;
// 拼接收到的 ByteBuf 内容
private ByteBuf cumulationBuf = Unpooled.buffer();
// private boolean initialized = false;
public HttpVisitorSecurityChannelHandler(Boolean isHttps) {
this.isHttps = isHttps;
}
@Override
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
// if (initialized) {
// // 已经初始化,直接透传
// ctx.fireChannelRead(msg);
// return;
// }
// 累加数据包
ByteBuf buf = (ByteBuf) msg;
cumulationBuf.writeBytes(buf);
String dataStr = cumulationBuf.toString(CharsetUtil.UTF_8);
int headerEndIndex = dataStr.indexOf("\r\n\r\n");
if (-1 == headerEndIndex) {
// 请求头还没读完,继续等
return;
}
// 获取Host请求头
byte[] bytes = new byte[buf.readableBytes()];
buf.readBytes(bytes);
String httpContent = new String(bytes);
String host = HttpUtil.getHostIgnorePort(httpContent); //test1.asgc.fun
String headerPart = dataStr.substring(0, headerEndIndex + 4);
String host = HttpUtil.getHostIgnorePort(headerPart); //test1.asgc.fun
log.debug("HttpProxy host: {}", host);
if (StringUtils.isBlank(host)) {
@@ -68,7 +88,7 @@ public class HttpVisitorSecurityChannelHandler extends ChannelInboundHandlerAdap
}
// 判断IP是否在该端口绑定的安全组允许的规则内
String ip = IpUtil.getRealRemoteIp(httpContent);
String ip = IpUtil.getRealRemoteIp(headerPart);
if (ip == null) {
ip = IpUtil.getRemoteIp(ctx);
}
@@ -82,9 +102,11 @@ public class HttpVisitorSecurityChannelHandler extends ChannelInboundHandlerAdap
ctx.channel().attr(Constants.SERVER_PORT).set(serverPort);
}
// 继续传播
buf.resetReaderIndex();
ctx.fireChannelRead(buf);
}
// 从此之后所有的 in 都是“直接透传”。
// 否则,若请求体过长,数据包被拆分为多个,后续的数据包都无法解析出host,导致转发数据不完整。
ctx.pipeline().remove(this);
// 继续传播
ctx.fireChannelRead(cumulationBuf);
}
}
@@ -49,10 +49,10 @@ neutrino:
data:
db:
# 数据库类型,目前支持h2、mysql、mariadb
type: h2
type: ${DB_TYPE:h2}
# 数据库连接URL
url: jdbc:h2:file:./data/db;MODE=MySQL;AUTO_SERVER=TRUE
url: ${DB_URL:jdbc:h2:file:./data/db;MODE=MySQL;AUTO_SERVER=TRUE}
# 数据库用户名
username:
username: ${DB_USER:}
# 数据库密码
password:
password: ${DB_PASSWORD:}
@@ -48,7 +48,7 @@
LEFT JOIN `user` u ON l.user_id = u.id
LEFT JOIN (SELECT license_id,sum(write_bytes) write_bytes,sum(read_bytes) read_bytes from flow_report_month GROUP BY license_id) frm ON l.id = frm.license_id
LEFT JOIN (SELECT license_id,sum(write_bytes) write_bytes,sum(read_bytes) read_bytes from flow_report_day
WHERE date >= #{curMonthBeginDate} AND #{curDayBeginDate}
WHERE date >= #{curMonthBeginDate} AND date &lt;= #{curDayBeginDate}
GROUP BY license_id) frd ON l.id = frd.license_id
LEFT JOIN (SELECT license_id,sum(write_bytes) write_bytes,sum(read_bytes) read_bytes from flow_report_minute
WHERE date >= #{curDayBeginDate} AND date &lt;= #{curDate}
+1 -1
View File
@@ -9,4 +9,4 @@
[本仓库的gitee镜像](https://gitee.com/xugaoyi/vuepress-theme-vdoing-doc)
hello
hello11
@@ -9,7 +9,8 @@ module.exports = {
title: "中微子代理",
description: '一个基于Netty的开源内网穿透神器',
base: '/neutrino-proxy/', // 默认'/'。如果你想将你的网站部署到如 https://foo.github.io/bar/,那么 base 应该被设置成 "/bar/",(否则页面将失去样式等文件)
// base: '/neutrino-proxy/', // 默认'/'。如果你想将你的网站部署到如 https://foo.github.io/bar/,那么 base 应该被设置成 "/bar/",(否则页面将失去样式等文件)
base: '/',
head: [ // 注入到页面<head> 中的标签,格式[tagName, { attrName: attrValue }, innerHTML?]
['link', {rel: 'icon', href: '/img/favicon.ico'}], //favicons,资源放在public文件夹
['meta', {name: 'keywords', content: 'vuepress,theme,blog,vdoing'}],
Binary file not shown.

After

Width:  |  Height:  |  Size: 167 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 159 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 217 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

@@ -6,7 +6,7 @@ article: false
---
::: tip
当前最新版本:2.0.2。从之前的版本升级过来,请参照:更新记录 > 版本记录
当前最新版本:2.0.3。从之前的版本升级过来,请参照:更新记录 > 版本记录.
:::
## 1、快速上手须知
@@ -16,7 +16,7 @@ article: false
- 快速上手中涉及到的配置,仅仅是快速体验所必须的配置,完整的配置请参照使用须知中的`服务端配置``客户端配置`
## 2、部署服务
- 根据需要自行选择jar、docker、原生部署、docker-compose任意一种完成部署,分别参见对应的文档
- 根据需要自行选择宝塔面板、jar、docker、原生部署、docker-compose任意一种完成部署,分别参见对应的文档
- 任何一种部署方式,不要求客户端与服务端一致。如:服务端采用docker部署,客户端可以用docker部署、也可以用jar、原生部署
- 管理后台说明
- 服务端部署成功后,访问http://{服务端IP}:8888打开后台管理页面。使用默认的管理员帐号登录:admin/123456
@@ -0,0 +1,43 @@
---
title: 通过宝塔面板部署
date: 2024-23-20 13:32:00
permalink: /pages/9e0fde/
article: false
---
## 前提
- 仅适用于宝塔面板9.2.0及以上版本
- 安装宝塔面板,前往[宝塔面板](https://www.bt.cn/new/download.html?r=dk_neuproxy)官网,选择正式版的脚本下载安装
## 部署
#### 1、登录宝塔面板,在左侧菜单栏中点击`Docker`
<img :src="$withBase('/img/baota/step1.png')"></img>
#### 2、首次会提示安装Docker和Docker Compose服务,点击立即安装,若已安装请忽略。
<img :src="$withBase('/img/baota/step2.png')"></img>
#### 3、安装完成后在Docker-应用商店中找到 中微子代理(搜索“NeutrinoProxy”),点击安装
<img :src="$withBase('/img/baota/step3.png')"></img>
#### 4、设置基本信息,点击确定
- 名称:应用名称,默认`neuproxy_随机字符`
- 版本:默认`latest`
- 允许外部访问:如您需通过`IP+Port`直接访问,请勾选,如您已经设置了域名,请不要勾选此处
- web管理端口:默认`9988`,可自行修改
- 客户端连接端口:默认`9989`,可自行修改
- 客户端SSL连接端口:默认`9990`,可自行修改
<img :src="$withBase('/img/baota/step4.png')"></img>
#### 5、提交后面板会自动进行应用初始化,大概需要`1-3`分钟,初始化完成后即可访问。
- 如果部署失败,可能是从DockerHub拉取镜像失败,可以自行设置镜像加速。
<img :src="$withBase('/img/baota/step5.png')"></img>
#### 6、访问中微子代理管理后台
<img :src="$withBase('/img/baota/step6.png')"></img>
@@ -3,6 +3,10 @@ title: 2.x
date: 2023-10-26 17:43:43
permalink: /pages/ff3519/
---
## 2.0.3
- 紧急bug修复:解决http请求拆包情况下域名映射失效的问题
## 2.0.2
- bug修复
- 解决安全组在ipv6场景下误拦截导致域名映射访问不通的问题
@@ -3,6 +3,7 @@ title: 里程碑
date: 2023-10-26 17:41:26
permalink: /pages/e406dd/
---
- 2024-12-20 中微子代理服务端支持宝塔面板一件部署
- 2024-12-10 2.0.2版本发布,新增域名管理,端口映射支持绑定多个域名
- 2023-12-21 2.0.1版本发布,jdk版本升级到21,支持安全组(黑/白名单IP限制)、限速
- 2023-10-31 2.0.0版本发布,升级jdk版本至jdk17、支持原生编译、去掉sqlite改为默认H2数据库
+1 -1
View File
@@ -26,7 +26,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
<revision>2.0.2</revision>
<revision>2.0.3</revision>
<native.version>0.9.28</native.version>
+1 -1
View File
@@ -9,7 +9,7 @@ MODULE_NAME=neutrino-proxy-client
deployDir="deploy"
clientDeployDir=$deployDir"/client"
machine=macos
VER=2.0.2
VER=2.0.3
#切到项目根目录
cd ../..
+1 -1
View File
@@ -9,7 +9,7 @@ MODULE_NAME=neutrino-proxy-server
deployDir="deploy"
serverDeployDir=$deployDir"/server"
machine=macos
VER=2.0.2
VER=2.0.3
#切到项目根目录
cd ../..