首页 \ 问答 \ 我的应用程序中有两个http请求,但我只想使用一个'http_proxy'(I have two http requests in my application, but I want only one use 'http_proxy')

我的应用程序中有两个http请求,但我只想使用一个'http_proxy'(I have two http requests in my application, but I want only one use 'http_proxy')

我有一个aplicattion,使本地请求http。 此应用程序还需要发出外部请求http。 但是应用程序所在的服务器不接受外部调用。 所以我创建了一个enviromnet变量'http_proxy',但它拦截了我的本地请求http。

我需要的是:我的外部请求使用'http_proxy'而我的本地请求不使用'http_proxy'。

对于本地请求我使用Django Rest Framework。 对于外部请求我使用SOAPpy。 (如果在这里我可以设置'http_proxy'环境变量,它应该是好的!)

这是我的SOAPpy请求:

proxy = 'https://username:password@instance.servicecom/table.do?SOAP'
server = SOAPProxy(proxy, 'http://www.service.com/')

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/')

原文:https://stackoverflow.com/questions/18356154
更新时间:2021-10-25 22:10

最满意答案

我的解决方案是改变lib。

我正在使用SOAPpy,现在我正在使用SUDS并且工作。

由于某种原因,SOAPpy中的param http_proxy错误地使用了代理。


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.

相关问答

更多

相关文章

更多

最新问答

更多
  • 如何从rails插件加载javascript文件(How to load javascript file from rails plugin)
  • 我正在研究有向图的DFS,如何到达没有任何边缘指向的节点?(I'm working on a DFS of a directed graph, How do I get to a node without any edges pointed at it?)
  • 无法在swift中展开可选项(can't unwrap optional in swift)
  • 如何从熊猫中提取列表?(How to extract a list from pandas?)
  • 计算不同列中2个值的出现次数(Count number of occurrences of 2 values in different columns)
  • Stack ExtJS 6 + Spring Boot(Stack ExtJS 6 + Spring Boot)
  • 如何安装ioreg?(How to install ioreg?)
  • Chrome Packaged app webview中的重音字符未显示(Accented characters in Chrome Packaged app webview not showing up)
  • C ++ recvfrom超时(C++ recvfrom timeout)
  • 如何使用实体框架(.edmx模型)和Razor视图为MVC4或MVC 5创建部分视图?(How can i create a Partial View for MVC4 or MVC 5 using Entity Framework (.edmx Model) with Razor Views?)
  • 子类QStyledItemDelegate忽略样式表(Subclassed QStyledItemDelegate ignores Stylesheet)
  • 有没有办法以编程方式配置ios应用程序的通知显示设置?(Is there a way to programmatically configure the notification display setting for an ios app?)
  • boost asio serial_port_service和serial_port有什么区别(What is the difference of boost asio serial_port_service and serial_port)
  • 如何通过解析nginx日志文件自动拒绝IP地址(How to deny ip address automatically by parsing nginx log file)
  • 如何在C#中为ASCII 127定义字符或字符串常量?(How might I define a character or string constant in C# for ASCII 127?)
  • 如何获得R中两个集合的差异?(How to get the differences of two set in R?)
  • 如何通过IMG-Activity找到定制路径(How to find the Customizing Path via IMG-Activity)
  • 可以用python窗口打开.py文件么
  • 指针的增量是否与整数的增量相同?(Does increment in pointer not same as that of integer? [closed])
  • 我无法删除使用Delphi7处于关系中的数据库的2个表中的所有数据(I can't delete all the data within 2 tables of a database which is in a relationship using Delphi7)
  • 使用反射向ArrayList添加未知类的对象(Add an object of unknown class to ArrayList with reflection)
  • 我想学JAVA 推荐下怎么 学
  • 什么是ASP.NET Identity的IUserSecurityStampStore 接口?(What is ASP.NET Identity's IUserSecurityStampStore interface?)
  • jquery如何获取多个同id的div,然后修改css属性左边间距left的值
  • jquery ui resizable:调整旋转对象的大小(jquery ui resizable: resizing the rotated objects)
  • 如何用sublime text编写微信小程序代码
  • Hibernate:在一个数据库表行中存储一个固定长度的数组(Hibernate: Storing an fixed length array in one database table row)
  • shared_ptr用于原始指针参数(shared_ptr for a raw pointer argument)
  • 将本地git分支与远程分支进行比较?(How to compare a local git branch with its remote branch?)
  • 如何在DOM中查找字符串并通过php或jQuery更改它们(how to find strings in DOM and change them by php or jQuery)