I am currently trying to set up a printer connected to a server following this tutuorial :
The original sketch is:
The issue is i'm trying to connect from a university where they use a proxy (without authentification).
So I tried to modify the sketch following the advices given here: http://forum.arduino.cc/index.php/topic,158690.0.html
Which led to this modification:
debug2("Attempting to connect to ", host);
if (client.connect("proxy.noc.titech.ac.jp", 3128)) {
digitalWrite(downloadLED, HIGH);
client.print("GET http://printer.gofreerange.com"); client.print("/printer/"); client.print(printerId); client.println(" HTTP/1.0");
client.print("Host: "); client.print(host); client.print(":"); client.println(port);
client.flush();
client.print("Accept: application/vnd.freerange.printer."); client.println(printerType);
client.print("X-Printer-Version: "); client.println(sketchVersion);
client.println();
boolean parsingHeader = true;
while(client.connected()) {
while(client.available()) {
if (parsingHeader) {
client.find((char*)"HTTP/1.1 ");
char statusCode[] = "xxx";
client.readBytes(statusCode, 3);
statusOk = (strcmp(statusCode, "200") == 0);
client.find((char*)"Content-Length: ");
char c;
while (isdigit(c = client.read())) {
content_length = content_length*10 + (c - '0');
}
debug2("Content length: ", content_length);
client.find((char*)"\n\r\n"); // the first \r may already have been read above
parsingHeader = false;
} else {
cache.write(client.read());
length++;
}
}
debug("Waiting for data");
}
debug("Server disconnected");
digitalWrite(downloadLED, LOW);
// Close the connection, and flush any unwritten bytes to the cache.
client.stop();
cache.seek(0);
However I'm still not able to make a full connection:
My printer is detected by the server however it seems that I do not receive any data.
Here are my proxy settings: 
Are there other part of the code that I should modify ?
I would be forever grateful if you guys could help me on this one. I spent countless of hours trying to figure out why is doesn't work.
I'm not sure if I gave all the needed info so if you need something, i would be glad to send it to you.
Thank you in advance !!
If you are connecting to the printer, then just read the response it sends first, just to see what it is sending. Replace "printerId" with the printerid.
client.println("GET http://printer.gofreerange.com/printer/printerId HTTP/1.1");
client.println("Host: printer.gofreerange.com");
client.println("Connection: close\r\n");
while(client.connected()) {
while(client.available()) {
char c = client.read();
Serial.print(c);
}
}
debug("Server disconnected");
digitalWrite(downloadLED, LOW);
// Close the connection, and flush any unwritten bytes to the cache.
client.stop();
9071499: ID: 7m1j0q4t2a8p4v0i
3086: IP: 192.168.11.8
3098: Attempting to connect to printer.gofreerange.com
connected to proxy
4585: Waiting for data
4585: Waiting for data
4586: Waiting for data
4606: Waiting for data
4632: Waiting for data
4657: Waiting for data
4682: Waiting for data
4707: Waiting for data
4731: Waiting for data
4757: Waiting for data
4782: Waiting for data
4806: Waiting for data
4832: Waiting for data
4856: Waiting for data
7931: Content length: 0
8931: Waiting for data
and then "Waiting for data" keeps on spawning until a very far "server disconnected"...
Either way, the ethernet shield still cant connect correctly..
SuperTim, how can I read what my printer is sending?
I hope these Serial Outputs are useful yo you.
Yeah sorry it wasn't clear on my reply but yes I tried with printerId replaced by the actual ID of the printer. No results
In the browser the link downloads a Zero bytes file. Try it by yourself: http://printer.gofreerange.com/printer/7m1j0q4t2a8p4v0i