View previous topic :: View next topic |
Author |
Message |
Radioman Guest
|
Using a Proxy Server with CCS TCP/IP stack |
Posted: Sat Aug 29, 2009 12:52 pm |
|
|
I have a data capture scheme that uses a PIC18F87J60, PCH, DHCP and the CCS TCP/IP stack, to work as a client to send data to a HTTP server. This all works fine but I now need to connect from a network that only allows external access through a proxy server. I can't figure out how to make the connection through the proxy which incidently does not need a username/password.
I assume that is not a simple as switching off the DHCP and manually setting the Gateway address to the proxy server IP and port number.
Can anybody point me in the right direction?
Thanks
Terry |
|
|
andrewg
Joined: 17 Aug 2005 Posts: 316 Location: Perth, Western Australia
|
|
Posted: Sat Aug 29, 2009 9:40 pm |
|
|
See http://www.faqs.org/rfcs/rfc2616.html section 5.1.2.
In short, you'll need to make GET requests with the full URI.
I don't see any need to turn DHCP off, and only set the Gateway address to the proxy server if the proxy server is, indeed, your gateway. I'd say you could keep DHCP on.
Note that the RFC above is for HTTP 1.1, there is also HTTP 1.0: http://www.faqs.org/rfcs/rfc1945.html
Probably the most relevant difference for simple GET requests is that HTTP 1.1 requires the Host header to be set, while HTTP 1.0 doesn't. _________________ Andrew |
|
|
Radioman Guest
|
Using a Proxy server |
Posted: Sun Aug 30, 2009 5:56 am |
|
|
Hi Andrew
Thanks for that, I obviously need to read the RFCs. I understand that I need to use a full URI with the proxy included as part of the server address. Perhaps I could be cheeky by asking you to could expand on this by explaining how I change my present setup.
I put my server address into remoteIPAddr (my board is a client and I use a POST command), so presumably, this is now needs to be the proxy servers address.
My HTTP header looks like:
POST /reading/folder_name HTTP/1.0\r\nHost:test.server.co.uk
Where do I put the server IP address and port?
Thanks for your help, at least it will be easy for me to the the updates to my units as they use your excellent ethernet bootloader!
Kind Regards
Terry |
|
|
andrewg
Joined: 17 Aug 2005 Posts: 316 Location: Perth, Western Australia
|
|
Posted: Sun Aug 30, 2009 7:39 am |
|
|
You open a TCP connection to the proxy (i.e. use the proxy IP address), then send something like: Code: | POST http://test.server.co.uk/reading/folder_name HTTP/1.1
Host:test.server.co.uk |
Bootloader? Must be a different Andrew! _________________ Andrew |
|
|
wireless
Joined: 02 Nov 2003 Posts: 16 Location: London England
|
Proxy Server |
Posted: Sun Aug 30, 2009 8:34 am |
|
|
Thanks for your help, Andrew. Will try it out as soon as I have set up a test Proxy Server.
Sorry to mix you up with the other WA Andrew!
Managed to remember my username so now I now not quite so anonymous.
Regards
Terry |
|
|
|