CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Using a Proxy Server with CCS TCP/IP stack

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Radioman
Guest







Using a Proxy Server with CCS TCP/IP stack
PostPosted: Sat Aug 29, 2009 12:52 pm     Reply with quote

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

View user's profile Send private message Visit poster's website

PostPosted: Sat Aug 29, 2009 9:40 pm     Reply with quote

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
PostPosted: Sun Aug 30, 2009 5:56 am     Reply with quote

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

View user's profile Send private message Visit poster's website

PostPosted: Sun Aug 30, 2009 7:39 am     Reply with quote

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

View user's profile Send private message

Proxy Server
PostPosted: Sun Aug 30, 2009 8:34 am     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group