Compare commits
53
Commits
2.0.2
..
gitcode_dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
40b7c3444d | ||
|
|
a55702f4f1 | ||
|
|
2e33f9ff1a | ||
|
|
23f3ec1ba2 | ||
|
|
666f071e37 | ||
|
|
bd56ce094a | ||
|
|
a7ee52dbf1 | ||
|
|
95764cdfb0 | ||
|
|
22ff47dbe6 | ||
|
|
391d664710 | ||
|
|
f26ed2d12e | ||
|
|
aa02b7b3c2 | ||
|
|
344bf11b88 | ||
|
|
f9ab82cd80 | ||
|
|
e97aacee8f | ||
|
|
59acada928 | ||
|
|
498ffeed46 | ||
|
|
0164e71f37 | ||
|
|
65abda93fb | ||
|
|
9c818e5fcf | ||
|
|
a8c05a9e5e | ||
|
|
01ac42f269 | ||
|
|
d4f77524cf | ||
|
|
d22b8df0ac | ||
|
|
c96d91c17c | ||
|
|
af9cf5d260 | ||
|
|
6eb31879ab | ||
|
|
8cf89e86d5 | ||
|
|
43aec0d8de | ||
|
|
d343231351 | ||
|
|
83519299f8 | ||
|
|
87c2ff846a | ||
|
|
02af8df384 | ||
|
|
81d8a41842 | ||
|
|
f2999fa384 | ||
|
|
37ff5abb28 | ||
|
|
4b4bcd2829 | ||
|
|
adc8cb3f66 | ||
|
|
81c3e3f219 | ||
|
|
587359d40e | ||
|
|
cedef6589f | ||
|
|
9a1f0c65ce | ||
|
|
031eeae706 | ||
|
|
32366a06f5 | ||
|
|
4873fc5084 | ||
|
|
fda50fb383 | ||
|
|
65da4cdc53 | ||
|
|
7b8e92b402 | ||
|
|
c5d736eafd | ||
|
|
85e5e72363 | ||
|
|
216bbb449f | ||
|
|
1378e808f8 | ||
|
|
8a23c83c83 |
@@ -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: |
|
||||
|
||||
@@ -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: |
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
version: '1.0'
|
||||
name: pipeline-docs-build
|
||||
displayName: 官网静态资源构建
|
||||
triggers:
|
||||
trigger: auto
|
||||
push:
|
||||
branches:
|
||||
precise:
|
||||
- master
|
||||
paths:
|
||||
include:
|
||||
- neutrino-proxy-vuepress.*
|
||||
variables:
|
||||
global:
|
||||
- git_token
|
||||
- username
|
||||
commit_name: aoshiguchen
|
||||
commit_email: [email protected]
|
||||
repo_url: https://gitee.com/dromara/neutrino-proxy.git
|
||||
target_branch: site
|
||||
stages:
|
||||
- name: stage-build
|
||||
displayName: 构建
|
||||
strategy: naturally
|
||||
trigger: auto
|
||||
executor:
|
||||
- asgc
|
||||
steps:
|
||||
- step: build@nodejs
|
||||
name: build_nodejs
|
||||
displayName: Nodejs 构建
|
||||
nodeVersion: 14.16.0
|
||||
commands:
|
||||
- '# 切换到工作目录'
|
||||
- ''
|
||||
- cd ./neutrino-proxy-vuepress
|
||||
- '# 设置NPM源,提升安装速度'
|
||||
- npm config set registry https://registry.npmmirror.com
|
||||
- ''
|
||||
- '# 执行编译命令'
|
||||
- npm install && npm run build
|
||||
- ''
|
||||
- '# 初始化git仓库'
|
||||
- cd docs/.vuepress/dist
|
||||
- git init
|
||||
- ''
|
||||
- '# 设置Git信息'
|
||||
- GIT_REPO_URL=$repo_url
|
||||
- GIT_USERNAME=$username
|
||||
- GIT_NAME=$commit_name
|
||||
- GIT_EMAIL=$commit_email
|
||||
- GIT_TOKEN=$git_token
|
||||
- echo "https://${GIT_USERNAME}:${GIT_TOKEN}@${GIT_REPO_URL#https://}" > ~/.git-credentials
|
||||
- git config --global credential.helper store
|
||||
- git remote add origin ${GIT_REPO_URL}
|
||||
- git config user.name ${GIT_NAME}
|
||||
- git config user.email ${GIT_EMAIL}
|
||||
- ''
|
||||
- '# 将构建产物推送到目标分支'
|
||||
- git add -A
|
||||
- '# git commit -m $GITEE_COMMIT_MESSAGE'
|
||||
- git commit -m "update"
|
||||
- git checkout -b $target_branch
|
||||
- git push -f origin $target_branch
|
||||
artifacts:
|
||||
- name: BUILD_ARTIFACT
|
||||
path:
|
||||
- ./neutrino-proxy-vuepress/docs/.vuepress/dist
|
||||
caches:
|
||||
- ~/.npm
|
||||
- ~/.yarn
|
||||
notify: []
|
||||
strategy:
|
||||
retry: '0'
|
||||
@@ -13,20 +13,18 @@
|
||||
</p>
|
||||
|
||||
# 1、简介
|
||||
- 中微子代理(neutrino-proxy)是一个基于netty的、开源的java内网穿透项目。
|
||||
- 中微子代理(neutrino-proxy)是一个基于netty的、开源的java代理项目。
|
||||
- 技术栈:Solon、MybatisPlus、Netty
|
||||
- 遵循MIT许可,因此您可以对它进行复制、修改、传播并用于任何个人或商业行为。
|
||||
- 官网地址1:https://neutrino-proxy.dromara.org
|
||||
- ~~官网地址2:https://dromara.gitee.io/neutrino-proxy~~
|
||||
- ~~官网地址3:https://neutrino-proxy-docs.asgc.fun~~
|
||||
- 快速上手请[点击这里](https://neutrino-proxy.dromara.org/neutrino-proxy/pages/793dcb/)
|
||||
|
||||
# 2、名称由来
|
||||
中微子,是轻子的一种,是组成自然界的最基本的粒子之一。它十分微小、不带电,可自由穿过地球,以接近光速运动,与其他物质的相互作用十分微弱,号称宇宙间的“隐身人”。
|
||||
|
||||
中微子是宇宙中穿透能力最强的物质,只有粒子之间的间隙小于10的负19次方米时,才能够阻挡住中微子。
|
||||
|
||||
因此以中微子命名,寓意着中微子代理拥有中微子"安全"、"快速"、"穿透力强"的特点。
|
||||
# 2、部署方式
|
||||
- 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/)
|
||||
|
||||
# 3、运行示例
|
||||

|
||||
|
||||
@@ -92,3 +92,5 @@
|
||||
- [x] 支持维护https证书
|
||||
- 端口映射支持支持绑定多个子域名
|
||||
- 选择择不同的主域名、子域名变更实时生效
|
||||
## 2.0.3
|
||||
- 解决http请求拆包情况下域名映射失效的问题
|
||||
|
||||
+31
-9
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -414,9 +414,9 @@ public class ProxyUtil {
|
||||
* 通过完整域名获取域名
|
||||
*/
|
||||
public static String getDomainNameByFullDomain(String fullDomain) {
|
||||
List<String> domains = domainToDomainNameIdMap.keySet().stream().filter(item -> fullDomain.endsWith(item)).collect(Collectors.toList());
|
||||
List<String> domains = domainToDomainNameIdMap.keySet().stream().sorted((a,b) -> b.length() - a.length()).filter(item -> fullDomain.endsWith(item)).collect(Collectors.toList());
|
||||
// 不存在 或者 有多条记录,返回null
|
||||
if (CollectionUtil.isEmpty(domains) || domains.size() > 1) {
|
||||
if (CollectionUtil.isEmpty(domains)) {
|
||||
return null;
|
||||
}
|
||||
return domains.getFirst();
|
||||
|
||||
@@ -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 <= #{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 <= #{curDate}
|
||||
|
||||
@@ -8,3 +8,5 @@
|
||||
[主题仓库](https://github.com/xugaoyi/vuepress-theme-vdoing)
|
||||
|
||||
[本仓库的gitee镜像](https://gitee.com/xugaoyi/vuepress-theme-vdoing-doc)
|
||||
|
||||
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数据库
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -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 ../..
|
||||
|
||||
@@ -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 ../..
|
||||
|
||||
Reference in New Issue
Block a user