Skip to content

Commit

Permalink
feat(server): allow custom listen addr
Browse files Browse the repository at this point in the history
Closes: #36
  • Loading branch information
1715173329 authored Oct 7, 2023
1 parent 849ef7f commit d27d288
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion htdocs/luci-static/resources/view/homeproxy/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,12 @@ return view.extend({
o.value('vmess', _('VMess'));
o.rmempty = false;

o = s.option(form.Value, 'port', _('Port'),
o = s.option(form.Value, 'address', _('Listen address'));
o.placeholder = '::';
o.datatype = 'ipaddr';
o.modalonly = true;

o = s.option(form.Value, 'port', _('Listen port'),
_('The port must be unique.'));
o.datatype = 'port';
o.validate = L.bind(hp.validateUniqueValue, this, data[0], 'server', 'port');
Expand Down
2 changes: 1 addition & 1 deletion root/etc/homeproxy/scripts/generate_server.uc
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ uci.foreach(uciconfig, uciserver, (cfg) => {
type: cfg.type,
tag: 'cfg-' + cfg['.name'] + '-in',

listen: '::',
listen: cfg.address || '::',
listen_port: strToInt(cfg.port),
tcp_fast_open: strToBool(cfg.tcp_fast_open),
tcp_multi_path: strToBool(cfg.tcp_multi_path),
Expand Down

0 comments on commit d27d288

Please sign in to comment.