本文整理了Java中java.net.HttpURLConnection.usingProxy()
方法的一些代码示例,展示了HttpURLConnection.usingProxy()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HttpURLConnection.usingProxy()
方法的具体详情如下:
包路径:java.net.HttpURLConnection
类名称:HttpURLConnection
方法名:usingProxy
[英]Returns whether this connection uses a proxy server or not.
[中]返回此连接是否使用代理服务器。
代码示例来源:origin: square/okhttp
@Override public boolean usingProxy() {
return delegate.usingProxy();
}
代码示例来源:origin: prestodb/presto
@Override public boolean usingProxy() {
return delegate.usingProxy();
}
代码示例来源:origin: jphp-group/jphp
@Getter
public boolean isUsingProxy() {
return ((HttpURLConnection)getWrappedObject()).usingProxy();
}
代码示例来源:origin: org.eclipse.jgit/org.eclipse.jgit
/** {@inheritDoc} */
@Override
public boolean usingProxy() {
return wrappedUrlConnection.usingProxy();
}
代码示例来源:origin: org.apache.cxf/cxf-rt-transports-http
protected boolean usingProxy() {
return connection.usingProxy();
}
protected void setFixedLengthStreamingMode(int i) {
代码示例来源:origin: apache/cxf
protected boolean usingProxy() {
return connection.usingProxy();
}
protected void setFixedLengthStreamingMode(int i) {
代码示例来源:origin: berlam/github-bucket
/** {@inheritDoc} */
@Override
public boolean usingProxy() {
return wrappedUrlConnection.usingProxy();
}
代码示例来源:origin: apiman/apiman
@Override public boolean usingProxy() {
return delegate.usingProxy();
}
代码示例来源:origin: org.apache.cxf/cxf-bundle-jaxrs
protected boolean usingProxy() {
return connection.usingProxy();
}
protected void setFixedLengthStreamingMode(int i) {
代码示例来源:origin: AgNO3/jcifs-ng
@Override
public boolean usingProxy () {
return this.connection.usingProxy();
}
代码示例来源:origin: org.codelibs/jcifs
@Override
public boolean usingProxy () {
return this.connection.usingProxy();
}
代码示例来源:origin: com.github.ljun20160606/okhttp-urlconnection
@Override public boolean usingProxy() {
return delegate.usingProxy();
}
代码示例来源:origin: com.jaeksoft/jcifs-krb5-jdk7
public boolean usingProxy() {
return connection.usingProxy();
}
代码示例来源:origin: org.samba.jcifs/jcifs
public boolean usingProxy() {
return connection.usingProxy();
}
代码示例来源:origin: com.squareup.okhttp/okhttp-urlconnection
@Override public boolean usingProxy() {
return delegate.usingProxy();
}
代码示例来源:origin: com.facebook.presto/presto-jdbc
@Override public boolean usingProxy() {
return delegate.usingProxy();
}
代码示例来源:origin: io.apiman/apiman-gateway-platforms-servlet
@Override public boolean usingProxy() {
return delegate.usingProxy();
}
代码示例来源:origin: prestosql/presto
@Override public boolean usingProxy() {
return delegate.usingProxy();
}
代码示例来源:origin: games647/ChangeSkin
private void printErrorStream(HttpURLConnection connection, int responseCode) throws IOException {
boolean proxy = connection.usingProxy();
//this necessary, because we cannot access input stream if the response code is something like 404
try (InputStream in = responseCode < HttpURLConnection.HTTP_BAD_REQUEST ?
connection.getInputStream() : connection.getErrorStream()) {
logger.error("Received response: {} for {} using proxy?: {}", responseCode, connection.getURL(), proxy);
try (BufferedReader reader = new BufferedReader(new InputStreamReader(in, StandardCharsets.UTF_8))) {
logger.error("Error stream: {}", CharStreams.toString(reader));
}
}
}
代码示例来源:origin: stackoverflow.com
Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("10.10.100.100", 80));
HttpURLConnection connection =
(HttpURLConnection)new URL("http://abc.abcd.com").openConnection(proxy);
((HttpURLConnection)new URL("http://abc.abcd.com").openConnection(proxy)).getInputStream();
System.out.println(connection.usingProxy());
内容来源于网络,如有侵权,请联系作者删除!