Making Arduino Ethernet work through proxy server

Hi,

I am working on a project that involves using Arduino Ethernet shield as a client that reads data from a web page. The problem is that I am using this project in the university network that has evrything running through a proxy server. On other networks such as my home network it can access the page and read the data easily.

I was thinking of modifying the Ethernet.h file myself but I luck a bit of networking knowledge so I didn't know how to begin. Is there a possible way out of this problem

Thanks.

What are the symptoms of the proxy server fail?
Does your university network require proxy settings in your computer?
Have you talked to the network administrator at the university about it?

The symptoms are that It fails to establish connection to the server. I have an "if else" loop that checks this as shown below

 if (client.connect(server, 80)) {
    Serial.println("connected");
    lcd.clear();
    lcd.print("connected");
    // get the informationi from the server
    client.println("GET /u/34458509/RemoteTest.html HTTP/1.0");  
    client.println();
    lcd.clear();
    lcd.println(inString);

    //Connected - Read the page
    return readPage(); //go and read the output

  }else{
    lcd.clear();
    lcd.print("connection fail");
    return "connection fail";

  }

So when using it in the university network, the lcd prints out "connection fail".

In order to connect my PC to university network I did some proxy settings and when I talked to the network admin he suggested that I have to do the same proxy settings on the arduino ethernet as well. So i got stuck on how to go about it.

Thanks.

That's not as easy as to make some settings in the Ethernet library. You have to implement your sketch differently if running at home or running behind the proxy. Behind the proxy you connect to the proxy and tell it to make an outgoing connection to the desired server. You have to decide if you wanna make a different version or if you wanna have both versions in one sketch.

I am just planning to implement the one that runs through the proxy. However, the problem is getting to tell the proxy to make connection to the desired server using the ethernet library.

Depending on the type of proxy in duty it can be just the change of the server address to that of the proxy and changing the path in the GET line to be the full URL you wanna access, e.g.

client.println("GET http://www.example.com/u/34458509/RemoteTest.html HTTP/1.0");

Thanks guys. I was able to run the arduino ethernet through the proxy server. I did some changes on the port number as well after consulting with the network admin again

Hi mc63,
I am having the same problem as you, can you please tell me what you did to solve proxy server problem?
reply asap.
:slight_smile:

I recommend talking to your network administrator. He/she will know the localnet ip and port to use for the proxy. If I use a proxy on my system, it is on the standard gateway, but redirects to a different port, like 8080.

edit: Use the proxy server localnet ip as the gateway in your network settings, and the proxy redirect port in the connection request.