Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a proxy server to AdGuard Home #391

Closed
Rediwed opened this issue Oct 18, 2018 · 17 comments
Closed

Add a proxy server to AdGuard Home #391

Rediwed opened this issue Oct 18, 2018 · 17 comments
Labels
duplicate Duplicate or merged issues. feature request P2: High

Comments

@Rediwed
Copy link

Rediwed commented Oct 18, 2018

Hi!

I wasn't sure where to post this, since this is not really an issue.

I'm interested in your Adguard Home product (the one from the recent newsletter). I've been thinking about setting up a computer to do some background ad-filtering, act as a VPN server and to act as a Traffic server. Basically; my home network is extremely fast, but I've only got a 20-30mbps downspeed. I wanted to speed up page loading, and file downloads by setting up Apache Traffic Server as a tiny, local, content distributor.

So my question is, is there any change Adguard Home can be (or might be able to in the future) set-up for other networking tools as well?

With kind regards,

A happy premium member.

@ameshkov
Copy link
Member

I guess even in the current state of AG Home, you can combine it with a proxy/VPN, but that'd require some additional configuration.

Or would you like us to include a proxy server in AG Home eventually?

@hoshsadiq
Copy link

hoshsadiq commented Apr 16, 2019

Sorry to jump in on this but I'd say the second. Combining this with a proxy/VPN will limit blocking to just DNS still, however, if there is a HTTP/S proxy option besides DNS, cosmetic adblock rules can be apply for anything that DNS doesn't block (rules which I'm guessing are currently ignored). This will result in having adblocking within browsers that do not support any adblocking extensions (looking at you chrome for android and browsers within TVs).

@hoshsadiq
Copy link

There's several go proxy libraries out there than can be potentially used. Best one I could find (at least it looks most well maintained) is https://github.com/elazarl/goproxy

@ameshkov
Copy link
Member

@hoshsadiq well, here you can take a look at me experimenting with migrating AdGuard filtering engine to Go:
https://github.com/AdguardTeam/urlfilter

There's even an example that uses goproxy (no cosmetic filters yet).

It will take quite more time to implement something feasible, though. Also, goproxy appears to be rather problematic and not really well maintained. I had to fork it and fix the most pressing issues: https://github.com/ameshkov/goproxy

@hoshsadiq
Copy link

Wow! You're way ahead of me. This is great.

Is urlfilter currently used by adguard home?

I'm thinking perhaps it's a possibility to provide three binaries, DNS only, Proxy only, and both combined. Reason being that people may want only DNS, or only proxy and both combined simply because that would mean you don't have to duplicate configuration and lists and it can all automagically work.

Is there a reason you've not made a PR to upstream?

It will take quite more time to implement something feasible, though.

Totally get that. I'd be happy to try and help. I will fork both repos over the weekend, and see what I can cook up.

@ameshkov
Copy link
Member

Is urlfilter currently used by adguard home?

It's not finished so not yet.

At first, we will use it's DNSEngine instead of the current one (as it brings some really important memory improvements).

What for the proxy implementation, I need to finish with the implementation of cosmetic rules, and only after that, we will add it as an experimental feature to AGH.

@ameshkov ameshkov changed the title New Adguard Home, add a proxy server? Add a proxy server to AdGuard Home Apr 23, 2019
@adrianh-za
Copy link

adrianh-za commented Apr 23, 2019

I would love AG Home to have built in socks proxy server

@Omoeba
Copy link

Omoeba commented Aug 23, 2019

I will be great if AGH also can create an interface and filter any traffic routed through that interface with an option to forward that traffic to another interface. That way AGH can receive traffic from TUN0, filter it, and then send it to ETH0 (the actual network interface).

@ameshkov
Copy link
Member

Can't it be achieved with tun2socks or smth like that?

@Omoeba
Copy link

Omoeba commented Aug 27, 2019

I don't think tun2socks can do anything with outgoing traffic

@ameshkov
Copy link
Member

Why that's exactly what it does: reads from the TUN interface, reroutes it to a SOCKS proxy (which does all the filtering), and then writes back to the TUN interface.

@R9980
Copy link

R9980 commented Oct 27, 2019

act as a VPN server and to act as a Traffic server.

@ameshkov so will we able to have another 'usage log' (hosts - both domains/ip) additional to 'query log' for web user interface with inbound/outbound bandwidth for each hosts?

@ameshkov
Copy link
Member

@Cloud-o yes, the proxy server will have a different log

@R9980
Copy link

R9980 commented Nov 1, 2019

Cool!

@ameshkov
Copy link
Member

ameshkov commented Nov 7, 2019

A quick update on this issue.

It takes more time than anticipated. It appeared that there are no good HTTP proxies implementations we can use for this purpose. elazarl/goproxy has some serious design flaws, google/martian is too complicated for our purpose.

Long story short, we had to come up with our own implementation that will be used as a basis for the AdGuard Home filtering proxy: https://github.com/AdguardTeam/gomitmproxy

This feature request is now assigned to the v0.102 milestone.

@ameshkov
Copy link
Member

If anyone wants to play with the first content blocking proxy implementation, you can try it here:
https://github.com/AdguardTeam/urlfilter/tree/master/cmd

There you can find instruction on how to build and run it.

@ghost ghost mentioned this issue Jan 16, 2020
@ghost ghost mentioned this issue Feb 9, 2020
@ameshkov ameshkov modified the milestones: v0.102, v0.103 Mar 3, 2020
@ghost ghost mentioned this issue Mar 7, 2020
1 task
@ghost ghost mentioned this issue Apr 27, 2020
@szolin
Copy link
Contributor

szolin commented Jun 2, 2020

See #1228

@szolin szolin closed this as completed Jun 2, 2020
@ameshkov ameshkov removed this from the v0.103 milestone Jun 2, 2020
@ameshkov ameshkov added the duplicate Duplicate or merged issues. label Jun 2, 2020
@ainar-g ainar-g mentioned this issue Nov 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate Duplicate or merged issues. feature request P2: High
Projects
None yet
Development

No branches or pull requests

7 participants