Skip to content

Commit

Permalink
feat(generator/client): Add mixed inbound
Browse files Browse the repository at this point in the history
  • Loading branch information
muink authored and 1715173329 committed Nov 30, 2023
1 parent 33aa7c4 commit bf70ce6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions root/etc/config/homeproxy
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
config homeproxy 'infra'
option __warning 'DO NOT EDIT THIS SECTION, OR YOU ARE ON YOUR OWN!'
option common_port '22,53,80,143,443,465,853,873,993,995,8080,8443,9418'
option mixed_port '5330'
option redirect_port '5331'
option tproxy_port '5332'
option dns_port '5333'
Expand Down
11 changes: 11 additions & 0 deletions root/etc/homeproxy/scripts/generate_client.uc
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ if (wan_dns.exitcode === 0 && trim(wan_dns.stdout))
else
wan_dns = (routing_mode in ['proxy_mainland_china', 'global']) ? '208.67.222.222' : '114.114.114.114';

const mixed_port = uci.get(uciconfig, uciinfra, 'mixed_port') || '5330';
const dns_port = uci.get(uciconfig, uciinfra, 'dns_port') || '5333';

let main_node, main_udp_node, dedicated_udp_node, default_outbound, sniff_override = '1',
Expand Down Expand Up @@ -414,6 +415,16 @@ push(config.inbounds, {
listen_port: int(dns_port)
});

push(config.inbounds, {
type: 'mixed',
tag: 'mixed-in',
listen: '::',
listen_port: int(mixed_port),
sniff: true,
sniff_override_destination: (sniff_override === '1'),
set_system_proxy: false
});

if (match(proxy_mode, /redirect/))
push(config.inbounds, {
type: 'redirect',
Expand Down

0 comments on commit bf70ce6

Please sign in to comment.