Skip to content

Commit c1ed6d8

Browse files
authored
Merge pull request vaxilu#187 from MHSanaei/dev
http header bug fixed
2 parents 304510a + 26a0481 commit c1ed6d8

File tree

8 files changed

+26
-29
lines changed

8 files changed

+26
-29
lines changed

database/db.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ func InitDB(dbPath string) error {
9292
if err != nil {
9393
return err
9494
}
95-
95+
9696
return nil
9797
}
9898

database/model/model.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ type Client struct {
8080
LimitIP int `json:"limitIp"`
8181
TotalGB int64 `json:"totalGB" form:"totalGB"`
8282
ExpiryTime int64 `json:"expiryTime" form:"expiryTime"`
83-
Enable bool `json:"enable" from:"enable"`
84-
TgID string `json:"tgId" from:"tgId"`
85-
SubID string `json:"subId" from:"subId"`
83+
Enable bool `json:"enable" form:"enable"`
84+
TgID string `json:"tgId" form:"tgId"`
85+
SubID string `json:"subId" form:"subId"`
8686
}

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ require (
88
github.com/gin-gonic/gin v1.9.0
99
github.com/go-cmd/cmd v1.4.1
1010
github.com/go-telegram-bot-api/telegram-bot-api/v5 v5.5.1
11+
github.com/goccy/go-json v0.10.0
1112
github.com/nicksnyder/go-i18n/v2 v2.2.1
1213
github.com/op/go-logging v0.0.0-20160315200505-970db520ece7
1314
github.com/pelletier/go-toml/v2 v2.0.7
@@ -30,7 +31,6 @@ require (
3031
github.com/go-playground/locales v0.14.1 // indirect
3132
github.com/go-playground/universal-translator v0.18.1 // indirect
3233
github.com/go-playground/validator/v10 v10.11.2 // indirect
33-
github.com/goccy/go-json v0.10.0 // indirect
3434
github.com/golang/protobuf v1.5.3 // indirect
3535
github.com/gorilla/context v1.1.1 // indirect
3636
github.com/gorilla/securecookie v1.1.1 // indirect

web/assets/js/model/xray.js

+2-5
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ Object.freeze(XTLS_FLOW_CONTROL);
106106
Object.freeze(TLS_FLOW_CONTROL);
107107
Object.freeze(TLS_VERSION_OPTION);
108108
Object.freeze(TLS_CIPHER_OPTION);
109-
Object.freeze(UTLS_FINGERPRINT);
110109
Object.freeze(ALPN_OPTION);
111110

112111
class XrayCommonClass {
@@ -177,17 +176,15 @@ class TcpStreamSettings extends XrayCommonClass {
177176
this.type = type;
178177
this.request = request;
179178
this.response = response;
180-
this.acceptProxyProtocol = acceptProxyProtocol;
181179
}
182180

183181
static fromJson(json={}) {
184182
let header = json.header;
185183
if (!header) {
186184
header = {};
187185
}
188-
return new TcpStreamSettings(
186+
return new TcpStreamSettings(json.acceptProxyProtocol,
189187
header.type,
190-
json.acceptProxyProtocol,
191188
TcpStreamSettings.TcpRequest.fromJson(header.request),
192189
TcpStreamSettings.TcpResponse.fromJson(header.response),
193190
);
@@ -201,7 +198,6 @@ class TcpStreamSettings extends XrayCommonClass {
201198
request: this.type === 'http' ? this.request.toJson() : undefined,
202199
response: this.type === 'http' ? this.response.toJson() : undefined,
203200
},
204-
acceptProxyProtocol: this.acceptProxyProtocol,
205201
};
206202
}
207203
}
@@ -994,6 +990,7 @@ class Inbound extends XrayCommonClass {
994990
case Protocols.VMESS:
995991
case Protocols.VLESS:
996992
case Protocols.TROJAN:
993+
case Protocols.SHADOWSOCKS:
997994
return true;
998995
default:
999996
return false;

web/html/xui/form/protocol/trojan.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<a-input type="number" v-model.number="client.limitIp" min="0" style="width: 70px;" ></a-input>
3333
</a-form-item>
3434
<a-form-item v-if="inbound.XTLS" label="Flow">
35-
<a-select v-model="client.flow" style="width: 150px">
35+
<a-select v-model="client.flow" style="width: 150px" :dropdown-class-name="siderDrawer.isDarkTheme ? 'ant-card-dark' : ''">
3636
<a-select-option value="">{{ i18n "none" }}</a-select-option>
3737
<a-select-option v-for="key in XTLS_FLOW_CONTROL" :value="key">[[ key ]]</a-select-option>
3838
</a-select>

web/html/xui/form/protocol/vless.html

+14-14
Original file line numberDiff line numberDiff line change
@@ -20,25 +20,25 @@
2020
<a-input v-model.trim="client.id" style="width: 300px;" ></a-input>
2121
</a-form-item>
2222
<a-form-item>
23-
<span slot="label">
24-
<span>{{ i18n "pages.inbounds.IPLimit" }}</span>
25-
<a-tooltip>
26-
<template slot="title">
27-
<span>{{ i18n "pages.inbounds.IPLimitDesc" }}</span>
28-
</template>
29-
<a-icon type="question-circle" theme="filled"></a-icon>
30-
</a-tooltip>
31-
</span>
32-
<a-input type="number" v-model.number="client.limitIp" min="0" style="width: 70px;" ></a-input>
23+
<span slot="label">
24+
<span>{{ i18n "pages.inbounds.IPLimit" }}</span>
25+
<a-tooltip>
26+
<template slot="title">
27+
<span>{{ i18n "pages.inbounds.IPLimitDesc" }}</span>
28+
</template>
29+
<a-icon type="question-circle" theme="filled"></a-icon>
30+
</a-tooltip>
31+
</span>
32+
<a-input type="number" v-model.number="client.limitIp" min="0" style="width: 70px;" ></a-input>
3333
</a-form-item>
3434
<a-form-item v-if="inbound.XTLS" label="Flow">
35-
<a-select v-model="inbound.settings.vlesses[index].flow" style="width: 150px">
35+
<a-select v-model="inbound.settings.vlesses[index].flow" style="width: 150px" :dropdown-class-name="siderDrawer.isDarkTheme ? 'ant-card-dark' : ''">
3636
<a-select-option value="" selected>{{ i18n "none" }}</a-select-option>
3737
<a-select-option v-for="key in XTLS_FLOW_CONTROL" :value="key">[[ key ]]</a-select-option>
3838
</a-select>
3939
</a-form-item>
4040
<a-form-item v-else-if="inbound.canEnableTlsFlow()" label="Flow" layout="inline">
41-
<a-select v-model="inbound.settings.vlesses[index].flow" style="width: 150px">
41+
<a-select v-model="inbound.settings.vlesses[index].flow" style="width: 150px" :dropdown-class-name="siderDrawer.isDarkTheme ? 'ant-card-dark' : ''">
4242
<a-select-option value="" selected>{{ i18n "none" }}</a-select-option>
4343
<a-select-option v-for="key in TLS_FLOW_CONTROL" :value="key">[[ key ]]</a-select-option>
4444
</a-select>
@@ -66,8 +66,8 @@
6666
</a-tooltip>
6767
</span>
6868
<a-date-picker :show-time="{ format: 'HH:mm' }" format="YYYY-MM-DD HH:mm"
69-
:dropdown-class-name="siderDrawer.isDarkTheme ? 'ant-card-dark' : ''"
70-
v-model="client._expiryTime" style="width: 170px;"></a-date-picker>
69+
:dropdown-class-name="siderDrawer.isDarkTheme ? 'ant-card-dark' : ''"
70+
v-model="client._expiryTime" style="width: 170px;"></a-date-picker>
7171
</a-form-item>
7272
</a-collapse-panel>
7373
</a-collapse>

web/html/xui/form/stream/stream_tcp.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<a-form-item label="AcceptProxyProtocol">
55
<a-switch v-model="inbound.stream.tcp.acceptProxyProtocol"></a-switch>
66
</a-form-item>
7-
<a-form-item label="HTTP Camouflage">
7+
<a-form-item label="HTTP {{ i18n "camouflage" }}">
88
<a-switch
99
:checked="inbound.stream.tcp.type === 'http'"
1010
@change="checked => inbound.stream.tcp.type = checked ? 'http' : 'none'">

web/html/xui/inbounds.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@
262262
{ title: '{{ i18n "pages.inbounds.operate" }}', width: 70, scopedSlots: { customRender: 'actions' } },
263263
{ title: '{{ i18n "pages.inbounds.enable" }}', width: 30, scopedSlots: { customRender: 'enable' } },
264264
{ title: '{{ i18n "pages.inbounds.client" }}', width: 80, scopedSlots: { customRender: 'client' } },
265-
{ title: '{{ i18n "pages.inbounds.traffic" }}↑|↓', width: 70, scopedSlots: { customRender: 'traffic' } },
265+
{ title: '{{ i18n "pages.inbounds.traffic" }}↑|↓', width: 120, scopedSlots: { customRender: 'traffic' } },
266266
{ title: '{{ i18n "pages.inbounds.expireDate" }}', width: 70, scopedSlots: { customRender: 'expiryTime' } },
267267
{ title: 'UID', width: 120, dataIndex: "id" },
268268
];
@@ -271,9 +271,9 @@
271271
{ title: '{{ i18n "pages.inbounds.operate" }}', width: 70, scopedSlots: { customRender: 'actions' } },
272272
{ title: '{{ i18n "pages.inbounds.enable" }}', width: 30, scopedSlots: { customRender: 'enable' } },
273273
{ title: '{{ i18n "pages.inbounds.client" }}', width: 80, scopedSlots: { customRender: 'client' } },
274-
{ title: '{{ i18n "pages.inbounds.traffic" }}↑|↓', width: 70, scopedSlots: { customRender: 'traffic' } },
274+
{ title: '{{ i18n "pages.inbounds.traffic" }}↑|↓', width: 120, scopedSlots: { customRender: 'traffic' } },
275275
{ title: '{{ i18n "pages.inbounds.expireDate" }}', width: 70, scopedSlots: { customRender: 'expiryTime' } },
276-
{ title: 'Password', width: 100, dataIndex: "password" },
276+
{ title: 'Password', width: 120, dataIndex: "password" },
277277
];
278278

279279
const app = new Vue({

0 commit comments

Comments
 (0)