Connect Through a Proxy

If you have difficulties connecting to your REST API from your programming environment, but API Creator is working as expected, the most likely explanation is that your browser is using a proxy to connect to the web. This is common in large organizations, and is typically used to filter web traffic for security reasons.

If this is the case, look at your browser settings and determine the address and port number of your proxy server. Once you have this information, setting up your program to use the proxy depends entirely on your programming platform.


In Java, failure to connect will show as an exception similar to the following:
Exception in thread "main" org.apache.http.conn.HttpHostConnectException: Connection to refused
       at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(
       at org.apache.http.impl.client.DefaultRequestDirector.execute(
       at org.apache.http.impl.client.AbstractHttpClient.execute(
       at org.apache.http.impl.client.AbstractHttpClient.execute(
       at org.apache.http.impl.client.AbstractHttpClient.execute(

Using a proxy can be done by simply setting two system properties:

System.setProperty("http.proxyHost", "proxyname");  // Enter your proxy name here
System.setPropery("http.proxyPort", "8080");

Some proxies require authentication. In that case, you will also need to add this:

Authenticator authenticator = new Authenticator() {
    public PasswordAuthentication getPasswordAuthentication() {
        return (new PasswordAuthentication("user", "password".toCharArray()));


JavaScript in the browser will of course use the browser's proxy settings, and therefore should never be a problem.

Server-side JavaScript (e.g. Node.js) can use a proxy by simply routing all traffic through the proxy, e.g.:
var http = require('http');
var google = http.createClient(3128, '');
var request = google.request('GET', '/',
  {'host': ''});

Other languages have different conventions, which also depend on which framework(s) and libraries you may be using.