I am wanting to make a TCP server that listens on port 443 so that it can receive HTTP requests and post back.
Right now I am using Apache & PHP to do this in the normal way, but is it possible to do this without a web server?
For instance I've built out a traditional TCP/IP client/server application in C# .NET. Is it possible to use this implementation to handle the HTTP requests instead of using a web server?
This project may help you to create a web server from scratch: MiniHttpd: an HTTP web server library using pure TCP/IP
But instead of dealing with many unnecessary details such as parsing headers, compression, authentication, ssl etc. I would use the built-in HttpListener class.
Here is a simplified(but working) multi-threaded WebServer
EDIT
I changed the server a little bit to make it host a RESTful WebService (
MyService
). It returns the the result as Json. You can call it ashttp://localhost:8080/?method=Calc&i=5&j=4
(I omitted many error checks for simplicity)At the lowest level, you can do this using an HTTP Listener Class.
http://geekswithblogs.net/Nitin/archive/2008/06/22/using-the-http-listener-class.aspx
I wrote something similar as a uni project once, so I can look for the code if you have any particular questions.
If you want to go higher-up you might look into web services.
Here's part of my code...see what you can do with it. :
...