2

I am trying to create a local proxy server in django, but I am unable to redirect the proxy requests to my view. In my system settings, I have set my django server as the proxy.

I am getting logs as such in my server:

[27/Dec/2016 22:01:40]"CONNECT www.google.co.in:443 HTTP/1.1" 404 1783

My URL configuration is:

url(r'^.*$', RedirectView.as_view(pattern_name=u'homepage', permanent=False))

What am I doing wrong while trying to redirect any browser request to my view?

4
  • You mean you want to redirect to google.com when / ? Commented Dec 28, 2016 at 7:09
  • When I hit google.com in my browser, the browser is forwarding the request to my proxy server. I want my server to pick up that request, hit google and return the response back to the browser.The problem is I don't know how to configure the urls.py so that a proxy request finds its way to my view. Commented Dec 28, 2016 at 8:19
  • django isn't suited for this. What exactly are you trying to achieve? Commented Dec 29, 2016 at 12:41
  • I am trying to build a content filtering proxy server so that all requests and responses pass through my django server. Commented Dec 29, 2016 at 18:17

1 Answer 1

2

you are comparing a proxy server with an wsgi based http server, when you run a Django development server ( python manage.py runserver), Django runs a wsgi compatible http server, that handles only requests ( URIs ?), not a tcp request content, so you need a http proxy server that copies the request buffer to the application server atleast.There are many available but if you need to implement own, there is already an answered question here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.