Skip to content

Commit

Permalink
端口配置默认开始修改为10000
Browse files Browse the repository at this point in the history
  • Loading branch information
EtoneYang committed Apr 18, 2024
1 parent b4c63cc commit fbb6d6e
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 10 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ x-ui-*.tar.gz
/release.sh
.sync*
main
.DS_Store
4 changes: 4 additions & 0 deletions CoCoding.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,7 @@
- 节点复制

> 入站节点操作增加复制功能,可以快速复制节点信息,端口和ID会重新生成,主要复制TLS证书信息。
- 订阅功能

> 添加订阅,订阅包括多个节点,可设置自动更新,防止端口被墙,可生成订阅链接,可设置有效日期
2 changes: 1 addition & 1 deletion web/assets/js/model/models.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ class DBInbound {
class AllSetting {

constructor(data) {
this.configPortStart = 50000;
this.configPortStart = 10000;
this.configPortEnd = 60000;
this.configCertDomain = "";
this.configCertFile = "";
Expand Down
2 changes: 1 addition & 1 deletion web/assets/js/model/xray.js
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ class Sniffing extends XrayCommonClass {
}

class Inbound extends XrayCommonClass {
constructor(port=RandomUtil.randomIntRange(50000, 60000),
constructor(port=RandomUtil.randomIntRange(10000, 60000),
listen='',
protocol=Protocols.VMESS,
settings=null,
Expand Down
2 changes: 1 addition & 1 deletion web/html/xui/inbound_modal.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
this.inbound = Inbound.fromJson(inbound.toJson());
} else {
this.inbound = new Inbound();
this.inbound.settings.port=RandomUtil.randomIntRange(allSettings.configPortStart||50000,
this.inbound.settings.port=RandomUtil.randomIntRange(allSettings.configPortStart||10000,
allSettings.configPortEnd||60000)
this.inbound.stream.tls.server = allSettings.configCertDomain||''
this.inbound.stream.tls.certs[0].certFile = allSettings.configCertFile||''
Expand Down
2 changes: 1 addition & 1 deletion web/html/xui/inbounds.html
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@
inbound.id = null
inbound.remark = `${inbound.remark}-copy`;
const id = RandomUtil.randomUUID()
inbound.port = RandomUtil.randomIntRange(this.allSettings.configPortStart||50000, this.allSettings.configPortEnd||60000)
inbound.port = RandomUtil.randomIntRange(this.allSettings.configPortStart||10000, this.allSettings.configPortEnd||60000)
inbound.settings[inbound.settings.protocol+'es'][0].id = id
inbound.settings.id = id
console.log("inbound", inbound)
Expand Down
2 changes: 1 addition & 1 deletion web/html/xui/setting.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<a-tabs default-active-key="10">
<a-tab-pane key="10" tab="快捷配置">
<a-list item-layout="horizontal" style="background: white">
<setting-list-item type="number" title="入站起始端口" desc="默认50000" v-model.number="allSetting.configPortStart"></setting-list-item>
<setting-list-item type="number" title="入站起始端口" desc="默认10000" v-model.number="allSetting.configPortStart"></setting-list-item>
<setting-list-item type="number" title="入站结束端口" desc="默认60000" v-model.number="allSetting.configPortEnd"></setting-list-item>
<setting-list-item type="text" title="入站TLS证书公钥文件路径" desc="填写一个 '/' 开头的绝对路径" v-model="allSetting.configCertFile"></setting-list-item>
<setting-list-item type="text" title="入站TLS证书密钥文件路径" desc="填写一个 '/' 开头的绝对路径" v-model="allSetting.configKeyFile"></setting-list-item>
Expand Down
10 changes: 5 additions & 5 deletions web/service/setting.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ var xrayTemplateConfig string

var defaultValueMap = map[string]string{

"configPortStart": "50000",
"configPortEnd": "60000",
"configCertDomain": "",
"configCertFile": "",
"configKeyFile": "",
"configPortStart": "10000",
"configPortEnd": "60000",
"configCertDomain": "",
"configCertFile": "",
"configKeyFile": "",
"xrayTemplateConfig": xrayTemplateConfig,
"webListen": "",
"webPort": "54321",
Expand Down

0 comments on commit fbb6d6e

Please sign in to comment.