1

I have an aplicattion that makes local requests http. This application also needs to make an external request http. But the server that application is located do not accept external calls. So I created a enviromnet variable 'http_proxy', but it intercept my local request http.

What I need is: my external request use to 'http_proxy' and my local request do not use to 'http_proxy'.

For local request Im using Django Rest Framework. For external request Im using SOAPpy. (If here I could set the 'http_proxy' environment variable it should be good!)

Here is my SOAPpy request:

proxy = 'https://username:password@instance.servicecom/table.do?SOAP'
server = SOAPProxy(proxy, 'http://www.service.com/')
brunozrk
  • 773
  • 1
  • 7
  • 14
  • 1
    Well, it looks like SOAPProxy supports `http_proxy` as a param, and even then you could probably just add additional headers as another solution. See: https://github.com/jeffkit/SOAPpy/blob/develop/SOAPpy/Client.py#L131 – Bartek Aug 21 '13 at 11:29
  • But that param do not instantiate the variable, right? – brunozrk Aug 21 '13 at 11:32
  • you said me to add additional headers, you know how should I do to django rest framework ignore the http_proxy? It may solve... – brunozrk Aug 21 '13 at 15:12
  • I have a proxy configured, example: proxy.teste.com:8080 when I pass http_proxy=proxy.teste.com:8080, the call will pass in proxy configured? – brunozrk Aug 21 '13 at 21:10
  • Sorry, I don't understand your problem! Can you elaborate? – Bartek Aug 22 '13 at 00:08
  • When I set the param http_proxy to my proxy (http_proxy=proxy.teste.com:8080), it will force the call out by this proxy? – brunozrk Aug 26 '13 at 11:02
  • Maybe, why don't you try it and see what the request looks like? – Bartek Aug 26 '13 at 11:35
  • I have tried and my return is: Connection reset by peer. – brunozrk Aug 26 '13 at 12:02
  • and my HTTP headers is: *** Outgoing HTTP headers ********************************************** POST https://instance.service.com/table.do?SOAP HTTP/1.0 Host: instance.service.com User-agent: SOAPpy 0.12.5 (http://pywebsvcs.sf.net) Content-type: text/xml; charset=UTF-8 Content-length: 594 SOAPAction: "getRecords" ************************************************************************ Is something wrong? – brunozrk Aug 26 '13 at 13:19

1 Answers1

0

My solution was to change the lib.

I was using SOAPpy, now Im using SUDS and worked.

For some reason the param http_proxy in SOAPpy was using the proxy incorrectly.

brunozrk
  • 773
  • 1
  • 7
  • 14