Skip to content

Commit

Permalink
fix(node): dont force override addr/port for direct
Browse files Browse the repository at this point in the history
  • Loading branch information
1715173329 authored Aug 18, 2023
1 parent ef08e58 commit 6d4eba1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
10 changes: 10 additions & 0 deletions htdocs/luci-static/resources/view/homeproxy/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
Expand Down Expand Up @@ -549,6 +551,14 @@ return view.extend({
so.modalonly = true;

/* Direct config */
so = ss.option(form.Value, 'override_address', _('Override address'));
so.datatype = 'host';
so.depends('type', 'direct');

so = ss.option(form.Value, 'override_port', _('Override 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'));
Expand Down
8 changes: 4 additions & 4 deletions root/etc/homeproxy/scripts/generate_client.uc
Original file line number Diff line number Diff line change
Expand Up @@ -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: node.override_address,
proxy_protocol: strToInt(node.proxy_protocol),
/* Hysteria */
up_mbps: strToInt(node.hysteria_down_mbps),
Expand Down

0 comments on commit 6d4eba1

Please sign in to comment.