Skip to main content
Commonmark migration
Source Link

Proxy Example

##Proxy Example SometimesSometimes you need to use a Proxy to access the internet. At my company we need to. StackWrap4J provides the ability to specify a Proxy server to rout connections through.

Below is a short code sample that configures the proxy, and then pulls every answer that I (2598) have given.

Proxy prox = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(
            "proxy.my.company.com", 80));
HttpClient.proxyServer = prox;
StackWrapper sw = new StackOverflow();
AnswerQuery query = new AnswerQuery();
query.setPageSize(PageQuery.MAX_PAGE_SIZE).setIds(2598);
List<Answer> allAnswers = new AnswerFromUserList(sw, query);

It is as simple as setting the public proxyServer property of the HttpClient class. That proxy will be used continually unless you set proxyServer to null.

##Proxy Example Sometimes you need to use a Proxy to access the internet. At my company we need to. StackWrap4J provides the ability to specify a Proxy server to rout connections through.

Below is a short code sample that configures the proxy, and then pulls every answer that I (2598) have given.

Proxy prox = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(
            "proxy.my.company.com", 80));
HttpClient.proxyServer = prox;
StackWrapper sw = new StackOverflow();
AnswerQuery query = new AnswerQuery();
query.setPageSize(PageQuery.MAX_PAGE_SIZE).setIds(2598);
List<Answer> allAnswers = new AnswerFromUserList(sw, query);

It is as simple as setting the public proxyServer property of the HttpClient class. That proxy will be used continually unless you set proxyServer to null.

Proxy Example

Sometimes you need to use a Proxy to access the internet. At my company we need to. StackWrap4J provides the ability to specify a Proxy server to rout connections through.

Below is a short code sample that configures the proxy, and then pulls every answer that I (2598) have given.

Proxy prox = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(
            "proxy.my.company.com", 80));
HttpClient.proxyServer = prox;
StackWrapper sw = new StackOverflow();
AnswerQuery query = new AnswerQuery();
query.setPageSize(PageQuery.MAX_PAGE_SIZE).setIds(2598);
List<Answer> allAnswers = new AnswerFromUserList(sw, query);

It is as simple as setting the public proxyServer property of the HttpClient class. That proxy will be used continually unless you set proxyServer to null.

deleted 24 characters in body
Source Link
jjnguy
  • 3k
  • 15
  • 14

##Proxy Example Sometimes you need to use a Proxy to access the internet. At my company we need to. StackWrap4J provides the ability to specify a Proxy server to rout connections through.

Below is a short code sample that configures the proxy, and then pulls every answer that I (2598) have given.

Proxy prox = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(
            "proxy.my.company.com", 80));
HttpClient.proxyServer = prox;
StackWrapper sw = new StackOverflow("RhtZB9-r0EKYJi-OjKSRUg");
AnswerQuery query = new AnswerQuery();
query.setPageSize(PageQuery.MAX_PAGE_SIZE).setIds(2598);
List<Answer> allAnswers = new AnswerFromUserList(sw, query);

It is as simple as setting the public proxyServer property of the HttpClient class. That proxy will be used continually unless you set proxyServer to null.

##Proxy Example Sometimes you need to use a Proxy to access the internet. At my company we need to. StackWrap4J provides the ability to specify a Proxy server to rout connections through.

Below is a short code sample that configures the proxy, and then pulls every answer that I (2598) have given.

Proxy prox = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(
            "proxy.my.company.com", 80));
HttpClient.proxyServer = prox;
StackWrapper sw = new StackOverflow("RhtZB9-r0EKYJi-OjKSRUg");
AnswerQuery query = new AnswerQuery();
query.setPageSize(PageQuery.MAX_PAGE_SIZE).setIds(2598);
List<Answer> allAnswers = new AnswerFromUserList(sw, query);

It is as simple as setting the public proxyServer property of the HttpClient class. That proxy will be used continually unless you set proxyServer to null.

##Proxy Example Sometimes you need to use a Proxy to access the internet. At my company we need to. StackWrap4J provides the ability to specify a Proxy server to rout connections through.

Below is a short code sample that configures the proxy, and then pulls every answer that I (2598) have given.

Proxy prox = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(
            "proxy.my.company.com", 80));
HttpClient.proxyServer = prox;
StackWrapper sw = new StackOverflow();
AnswerQuery query = new AnswerQuery();
query.setPageSize(PageQuery.MAX_PAGE_SIZE).setIds(2598);
List<Answer> allAnswers = new AnswerFromUserList(sw, query);

It is as simple as setting the public proxyServer property of the HttpClient class. That proxy will be used continually unless you set proxyServer to null.

Post Made Community Wiki
Source Link
jjnguy
  • 3k
  • 15
  • 14

##Proxy Example Sometimes you need to use a Proxy to access the internet. At my company we need to. StackWrap4J provides the ability to specify a Proxy server to rout connections through.

Below is a short code sample that configures the proxy, and then pulls every answer that I (2598) have given.

Proxy prox = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(
            "proxy.my.company.com", 80));
HttpClient.proxyServer = prox;
StackWrapper sw = new StackOverflow("RhtZB9-r0EKYJi-OjKSRUg");
AnswerQuery query = new AnswerQuery();
query.setPageSize(PageQuery.MAX_PAGE_SIZE).setIds(2598);
List<Answer> allAnswers = new AnswerFromUserList(sw, query);

It is as simple as setting the public proxyServer property of the HttpClient class. That proxy will be used continually unless you set proxyServer to null.