tags:

views:

28

answers:

1

We have a custom chat application(c#) which uses TCPClient. We are having problem on clients who are behind Firewall or proxy. We know that these client can browse the internet without a problem so we decided to change our TCPClient application so that It uses HTTP messages to communicate.

Will it be enough just to wrap our text massages with standard HTML tags and HTTP headers? We need a long lasting connection. Does keep-alive have a limit? Do firewalls or proxies have time limits for "alive" connections.

+1  A: 

You would need to change your protocol, probably pretty significantly. There's no guarantee that a proxy is going to use the same TCP connection for subsequent HTTP requests, it has the freedom to close any connection after receiving a message from the server, and they generally will after only a few idle seconds.

Unless your protocol can work stateless, then it isn't going to work over HTTP through a proxy.

Adam Ruth
himm... our chat application needs an open connection and our server differentiates clients by their sockets then we will need to implement something to track state of clients.
Chat applications over HTTP (well, pretty much all applications over HTTP) us a cookie or token to keep track of clients that is passed to the client on the first connection and stored in a local database.Another thing to keep in mind is that with HTTP only the client can initiate a connection. The server can't "push" anything down, only respond to requests. So you'll need to use a polling mechanism.
Adam Ruth