强制Java Web Start使用Fiddler之类的代理而不接触代码 [英] Force java web start to use a proxy like Fiddler without touching code
问题描述
对于自动软件项目,我需要Java Web Start应用程序的一些请求和响应.
For a automatic software project i need some requests and responses from a Java Web Start application.
因此,我安装了Fiddler Web调试器,然后尝试使用此Fiddler代理来嗅探所有请求.
So i installed Fiddler Web Debugger and then i tried to use this fiddler proxy to sniff all requests.
问题是Java Web Start应用程序.
The problem is the Java Web Start application.
我将其添加到.jnlp文件,并希望它能工作...没有! :(
I added this to the .jnlp file and hoped that it works... It doesnt! :(
<property name="http.proxyHost" value="127.0.0.1"/>
<property name="http.proxyPort" value="8888"/>
应用程序将忽略它.
然后我尝试设置Java设置.
Then i tried to set up the Java settings.
它也不起作用;(
Wireshark无法解密https/ssl请求...
Wireshark cant decrypt the https/ssl requests...
我该怎么做才能解密请求或读取请求,或者让小提琴代理使用Java Web Start应用程序.
What could i do to decrypt the requests or to read the requests OR to let use the java web start application the fiddler proxy.
为什么Java无法使用系统代理? >.>
Why java cant use the system proxy? >.>
推荐答案
有另一种方法:
1.) 您可以在java系统设置中设置代理.打开系统设置\ Java \ Java控制面板\网络设置.在那里,您可以配置代理...
1.) You can set the proxy in the java system settings. Open System Settings \ Java \ Java Control Panel \ Networksettings. There you are able to configure the proxy...
2.) 验证代理是否配置正确的另一种可能性是在Java程序中进行检查:
2.) Another possibility to verify if your proxy is configured correctly is to check within your java programm:
private Proxy findProxy(URI uri)
{
try
{
ProxySelector selector = ProxySelector.getDefault();
List<Proxy> proxyList = selector.select(uri);
if (proxyList.size() > 1)
return proxyList.get(0);
}
catch (IllegalArgumentException e)
{
}
return Proxy.NO_PROXY;
}
3.) 在程序中设置系统设置:
3.) Set the system settings within your programm:
System.getProperties().put( "proxySet", "true" );
System.getProperties().put( "proxyHost", "myProxyMachineName" );
System.getProperties().put( "proxyPort", "85" );
If you need authentication also, use (more details here)
URLConnection connection = url.openConnection();
String password = "username:password";
String encodedPassword = base64Encode( password );
connection.setRequestProperty( "Proxy-Authorization", encodedPassword );
这篇关于强制Java Web Start使用Fiddler之类的代理而不接触代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!