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

Request and response filter #9

Open
bromokun opened this issue Mar 13, 2013 · 1 comment
Open

Request and response filter #9

bromokun opened this issue Mar 13, 2013 · 1 comment

Comments

@bromokun
Copy link

Dear sir,

I want to use Surrogate as a proxy server in my house LAN, to filter the content of both request and response from unwanted content from my children, such as porn.

I already use a free anti porn app on my children laptop, but it doesn't stop the Google search on displaying previews of nasty pictures.

I did some Erlang codes before, but to study the way your codes works, might takes sometime, can you please point out where could I extend your code, so I can do content filtering on both request & response.

Thank you very much in advanced,

Regards,
Bromo

@skruger
Copy link
Owner

skruger commented Mar 13, 2013

Indeed I can.

This is one of the use cases that I had in mind when I implemented stream filters. My next task with stream filters is to validate that they still work for filtering responses and also to add buffering so you don't have to assemble the packets yourself in a filter.

This doc is a good starting point: https://github.com/skruger/Surrogate/wiki/Stream-Filters

In essence what you need to do is create a module that implements the stream_filter behaviour. This includes implementing start_instance/0 and process_hook/4.

An example of implementing authentication as a filter module:
https://github.com/skruger/Surrogate/blob/master/src/filter_auth_basic.erl

Internet content filtering is something that I would like to make a first class feature and dealing with filtering things like google and facebook which run ssl all the time are the reason why I started working on uCA and the SSL spoofing feature recently. The SSL spoofing feature generates an SSL certificate from your own certificate authority and presents that certificate to the client. If the private CA is trusted by all of your computers then the cert is accepted and the traffic is decrypted and filtered just like everything else.

Let me know if you have questions about stream filters. You probably will as my work in progress refactoring has probably resulted in a little breakage, but I'll get that fixed soon enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants