yggdrasil-network / yggstack

Yggdrasil + Netstack (instead of TUN)
Other
21 stars 6 forks source link

Custom routing settings? #6

Open d47081 opened 2 months ago

d47081 commented 2 months ago

Hello,

what about some basic routing regex to pass the non-yggdrasil connections to internet?

for example, when I'm connecting with FF, can't access the internet without using third-party proxy. it would be useful, because one proxy over another one is harder than just connect remote yggdrasil router.

or maybe I miss some mask in FF - because it's *.com only supported in No proxy for settings, no port or IP4

basilgello commented 2 months ago

You can do that using proxy PAC scripts. If you access your Ygg domains via .pk.ygg or Alfis .ygg you can filter them in PAC file. Or you can use some trickery to filter Ygg IPv6 addresses so the correct proxy is chosen.

The latter task sounds interesting to me so I can try crafting such a PAC file as PoC.

d47081 commented 2 months ago

Yes, did it!

If somebody wants to setup, here is working example:

function FindProxyForURL(url, host) 
{
  if (/^0{0,1}[2-3][a-f0-9]{0,2}:/.test(host) || /\.ygg$/.test(host))
  {
    return 'SOCKS5 127.0.0.1:1080; DIRECT';
  }
}

http://[222:a8e4:50cd:55c:788e:b0a5:4e2f:a92c]/yggdrasil:network_connection_variants#pac

d47081 commented 2 months ago

Just feature could be useful as Yggstack option from the box

Because I'm using different software that not always support PAC / JS and won't launch another proxy over existing one.