Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Proxy server using Django

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?

like image 663
Aakash Avatar asked Apr 23 '26 00:04

Aakash


1 Answers

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

like image 155
Renjith Thankachan Avatar answered Apr 24 '26 23:04

Renjith Thankachan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!