Socket programming and networking examples in Java.
All other traffic is blocked by most of the firewalls as compared to the HTTP protocol. Hence layering of the protocol at the HTTP top could be a great idea, for example like REST, XML-RPC and SOAP does.
For layering protocol at top of HTTP, data shall be sent back & forth b/w server and client inside the HTTP responses and requests. Keep it in mind that HTTP response & request consists of more than just HTML & text. Binary data could also be sent in there.