Go Down

Topic: GET request through proxy connection (Read 13372 times) previous topic - next topic


Hi there,

I've searched a lot on this board and all over search engines and didn't manage to find an answer to my question. Some others seem to encounter same troubles but no one has ever answered... Is it because it's an impossible quest ?

So, here's the issues I'm facing :

- I develop a small program that send an HTTP GET request to our web server and reads the data to launch various actions.
- This program works like a charm from my home connection : it connects, retrieves and processes data.
- When at school everything fails. According to the network administrator it would be caused by the proxy configuration.
- Trying to "test in school conditions at home" I decided to work with one free proxy found on the web. Set in my web browser, this proxy works. Now the REAL problem is : how to tell my Arduino to go and connect through this proxy (or my school's !!!).

After hours of tests I decide to go back to the original DNSWebClient example and tweak it to work with the proxy... still unsuccessful.

I made changes to that example by adding the proxy server address in the gateway var but where to tell it the HTTP proxy port ?
Oddly I can tell any gateway IP to the "Ethernet.begin" function and I'll still get "Client.connect" to print "connected". Strange...

But when it comes to testing "client.connected" it returns FALSE !!!

If anyone knows about proxies or any way to bypass that proxy thing and manage to make my program at school it'd be wonderful.

Thanks guys for your help !


Use the proxy server as the "server" part of the GET request and use the full URL as the URI part of the GET request:

Direct connection:
Code: [Select]

  // if you get a connection, report back via serial:
  if (client.connect("www.actualserver.com", 80)) {

    // Make a HTTP request through the connected server:
    client.println("GET /search?q=arduino HTTP/1.0");

Proxy connection:
Code: [Select]

  // if you get a connection, report back via serial:
  if (client.connect("www.proxy.com", 8080)) {  // This is connecting to the proxy

    // Make a HTTP request through proxy:
    client.println("GET http://www.actualserver.com/search?q=arduino HTTP/1.0");
Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp


hi, thank you very much !!!!!!!!
This program is working very well !!
Thank you for your help.

Go Up