diff --git a/htdocs/luci-static/resources/view/homeproxy/node.js b/htdocs/luci-static/resources/view/homeproxy/node.js index c3bbc483..1fa43654 100644 --- a/htdocs/luci-static/resources/view/homeproxy/node.js +++ b/htdocs/luci-static/resources/view/homeproxy/node.js @@ -504,10 +504,12 @@ return view.extend({ so = ss.option(form.Value, 'address', _('Address')); so.datatype = 'host'; + so.depends({'type': 'direct', '!reverse': true}); so.rmempty = false; so = ss.option(form.Value, 'port', _('Port')); so.datatype = 'port'; + so.depends({'type': 'direct', '!reverse': true}); so.rmempty = false; so = ss.option(form.Value, 'username', _('Username')); @@ -549,6 +551,16 @@ return view.extend({ so.modalonly = true; /* Direct config */ + so = ss.option(form.Value, 'override_address', _('Override address'), + _('Override the connection destination address.')); + so.datatype = 'host'; + so.depends('type', 'direct'); + + so = ss.option(form.Value, 'override_port', _('Override port'), + _('Override the connection destination port.')); + so.datatype = 'port'; + so.depends('type', 'direct'); + so = ss.option(form.ListValue, 'proxy_protocol', _('Proxy protocol'), _('Write Proxy Protocol in the connection header.')); so.value('', _('Disable')); diff --git a/root/etc/homeproxy/scripts/generate_client.uc b/root/etc/homeproxy/scripts/generate_client.uc index d6301820..f84ec16c 100755 --- a/root/etc/homeproxy/scripts/generate_client.uc +++ b/root/etc/homeproxy/scripts/generate_client.uc @@ -123,15 +123,15 @@ function generate_outbound(node) { tag: 'cfg-' + node['.name'] + '-out', routing_mark: strToInt(self_mark), - server: (node.type !== 'direct') ? node.address : null, - server_port: (node.type !== 'direct') ? int(node.port) : null, + server: node.address, + server_port: int(node.port), username: node.username, password: node.password, /* Direct */ - override_address: (node.type === 'direct') ? node.address : null, - override_port: (node.type === 'direct') ? node.port : null, + override_address: node.override_address, + override_port: int(node.override_port), proxy_protocol: strToInt(node.proxy_protocol), /* Hysteria */ up_mbps: strToInt(node.hysteria_down_mbps),