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)