我尝试通过需要身份验证的https连接到服务器.此外,我在中间有一个http代理,也需要身份验证.我使用ProxyAuthSecurityHandler对代理进行身份验证,使用BasicAuthSecurityHandler对服务器进行身份验证.
接收java.io.IOException:无法通过代理隧道.
Proxy returns "HTTP/1.1 407 Proxy Auth Required"
at sun.net.www.protocol.http.HttpURLConnection.doTunneling(HttpURLConnection.java:1525)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect (AbstractDelegateHttpsURLConnection.java:164)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:133)
at org.apache.wink.client.internal.handlers.HttpURLConnectionHandler.processRequest(HttpURLConnectionHandler.java:97)
Run Code Online (Sandbox Code Playgroud)
我注意到ProxyAuthSecurityHandler的实现期待响应代码407但是,在调试期间,由于抛出了IOException,我们永远不会到达第二部分.
代码快照:
ClientConfig configuration = new ClientConfig();
configuration.connectTimeout(timeout);
MyBasicAuthenticationSecurityHandler basicAuthProps = new MyBasicAuthenticationSecurityHandler();
basicAuthProps.setUserName(user);
basicAuthProps.setPassword(password);
configuration.handlers(basicAuthProps);
if ("true".equals(System.getProperty("setProxy"))) {
configuration.proxyHost(proxyHost);
if ((proxyPort != null) && !proxyPort.equals("")) {
configuration.proxyPort(Integer.parseInt(proxyPort));
}
MyProxyAuthSecurityHandler proxyAuthSecHandler =
new MyProxyAuthSecurityHandler();
proxyAuthSecHandler.setUserName(proxyUser);
proxyAuthSecHandler.setPassword(proxyPass);
configuration.handlers(proxyAuthSecHandler);
}
restClient = new RestClient(configuration);
// create the createResourceWithSessionCookies instance to interact with
Resource resource = getResource(loginUrl);
// Request body is empty
ClientResponse response = …Run Code Online (Sandbox Code Playgroud) 可能在这里做一些非常愚蠢的事情,但是我在通过Tor自动进行身份验证时遇到了一些麻烦.
我使用32位ubuntu 12.04与混淆桥.
这应该是所有相关的代码,但请告诉我是否有其他一些在调试此问题时有用:
import socket
import socks
import httplib
def connectTor():
socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, "127.0.0.1", 9050, True)
#9050 is the Tor proxy port
socket.socket = socks.socksocket
def newIdentity():
socks.setdefaultproxy() #Disconnect from Tor network
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(("127.0.0.1", 46594))
s.send("AUTHENTICATE\r\n")
response = s.recv(128)
#128 bytes of data for now, just to see how Tor responds
print response
if response.startswith("250"): #250 is the code for a positive response from Tor
s.send("SIGNAL NEWNYM\r\n") #Use a new identity
s.close()
connectTor() #Just to make sure …Run Code Online (Sandbox Code Playgroud) 我需要使用我的Heroku/Rails应用程序连接到API,我需要有静态IP.
我知道附加组件proximo - https://devcenter.heroku.com/articles/proximo - 但它的价格非常高,所以这是不可能的.
在我的情况下,大多数人最终部署到EC2而使用弹性IP作为他们的静态IP.我也试过这个并且它有效,但我发现整个EC2的流程真的很麻烦.
我已经在一些答案中读到可以设置EC2服务器并将其用作Heroku/Rails应用程序的代理 - 用于SFTP的Heroku静态IP - 但对于不是非常服务器的人来说这听起来非常神秘 -精明.
有人可以提供有关如何设置Heroku/Rails应用程序以将EC2实例用作代理的分步教程吗?
我们的企业网络具有从外部到内部IP网络的访问的专有协议.任务是从标准的Android应用程序(Web浏览器,电子邮件客户端等)访问内部资源.
我们已经创建了一个应用程序,可以将通道发布到网络.
所以问题是:有没有办法注册我的应用程序:
...而不是通过已建立的渠道捕获并将所有HTTP请求或IP流量重定向到公司网络?
如何更改Awesomium(c#)中的代理设置?我现在有这个简单的代码
Awesomium.Windows.Forms.WebControl browser =
new Awesomium.Windows.Forms.WebControl();
browser = new Awesomium.Windows.Forms.WebControl();
browser.Paint += browser_Paint;
browser.Location = new System.Drawing.Point(1, 1);
browser.Name = "webControl";
browser.Size = new System.Drawing.Size(1024, 768);
browser.Source = new System.Uri("http://checkip.dyndns.com/", System.UriKind.Absolute);
browser.TabIndex = 0;
Run Code Online (Sandbox Code Playgroud) 我想用nginx来平衡我的网站.
nginx wiki中的负载平衡是代理,因此从前端服务器下载的实际文件.(http://wiki.nginx.org/LoadBalanceExample)
这就是我需要平衡的方式:
用户请求文件:
nginx将用户重定向到其中一个服务器(带有Location标头):
这可能与nginx有关吗?
有没有办法通过NodeJS中的SOCKS5代理发送UDP数据包?
同样,是否可以将UDP套接字绑定到特定的localAddress?
我能够在JGit中使用clone命令克隆repo
Repo是http,当然,当我落后于代理时,它无法克隆
您能帮我解决一下代码示例如何在java中使用代理配置JGit
谢谢!
为了检查URL是否是图像,我使用PHP函数get_headers。在正常情况下,它运行良好。
但是当我落后于代理服务器时,它将导致超时异常。我有同样的问题,file_put_contents但是我通过添加上下文参数解决了。但是,该get_headers函数没有类似的参数。
你知道该怎么办吗?
尝试使用MITMProxy对Firefox浏览器发出的请求进行自定义转发,以便它们通过运行时选择的几个代理之一.对我们来说,它的表现太慢了.请记住我们在Python 2.7中运行它.
过程如下:
requests请求,并通过给定代理(不受我们控制并需要身份验证)从目标服务器获取数据.情况似乎是这个过程太慢了,我认为这可能有很多原因.可能是因为启用了设置会降低性能(例如,记录过多),正在使用的过程不适合作业(完全合理)或完全不同的程序.
我们怎样才能让这个跑得更快?
非常感谢!任何和所有建议将不胜感激!