Skip to content

Commit

Permalink
feat(server): add mixed inbound
Browse files Browse the repository at this point in the history
  • Loading branch information
xjqxziii committed Sep 8, 2024
1 parent c098212 commit 6e79e71
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions htdocs/luci-static/resources/view/homeproxy/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ return view.extend({
o.value('hysteria2', _('Hysteria2'));
o.value('naive', _('NaïveProxy'));
}
o.value('mixed', _('Mixed'));
o.value('shadowsocks', _('Shadowsocks'));
o.value('socks', _('Socks'));
o.value('trojan', _('Trojan'));
Expand All @@ -169,13 +170,14 @@ return view.extend({

o = s.option(form.Value, 'username', _('Username'));
o.depends('type', 'http');
o.depends('type', 'mixed');
o.depends('type', 'naive');
o.depends('type', 'socks');
o.modalonly = true;

o = s.option(form.Value, 'password', _('Password'));
o.password = true;
o.depends({'type': /^(http|naive|socks)$/, 'username': /[\s\S]/});
o.depends({'type': /^(http|mixed|naive|socks)$/, 'username': /[\s\S]/});
o.depends('type', 'hysteria2');
o.depends('type', 'shadowsocks');
o.depends('type', 'trojan');
Expand All @@ -194,7 +196,7 @@ return view.extend({
o.validate = function(section_id, value) {
if (section_id) {
var type = this.map.lookupOption('type', section_id)[0].formvalue(section_id);
var required_type = [ 'http', 'naive', 'socks', 'shadowsocks' ];
var required_type = [ 'http', 'mixed', 'naive', 'socks', 'shadowsocks' ];

if (required_type.includes(type)) {
if (type === 'shadowsocks') {
Expand Down
4 changes: 2 additions & 2 deletions root/etc/homeproxy/scripts/generate_server.uc
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ uci.foreach(uciconfig, uciserver, (cfg) => {
zero_rtt_handshake: strToBool(cfg.tuic_enable_zero_rtt),
heartbeat: cfg.tuic_heartbeat ? (cfg.tuic_heartbeat + 's') : null,

/* HTTP / Hysteria (2) / Socks / Trojan / Tuic / VLESS / VMess */
/* HTTP / Hysteria (2) / Mixed / Socks / Trojan / Tuic / VLESS / VMess */
users: (cfg.type !== 'shadowsocks') ? [
{
name: !(cfg.type in ['http', 'socks']) ? 'cfg-' + cfg['.name'] + '-server' : null,
name: !(cfg.type in ['http', 'mixed', 'socks']) ? 'cfg-' + cfg['.name'] + '-server' : null,
username: cfg.username,
password: cfg.password,

Expand Down

0 comments on commit 6e79e71

Please sign in to comment.