This is a very simple HTTP server for Unix, using fork(). It's very easy to use
- include header
httpd.h
- write your route method, handling requests.
- call
serve_forever("12913")
to start serving on port 12913
This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.
Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).
; Allow the linker to find the _start symbol. The linker will begin program execution | |
; there. | |
global _start | |
; Start the .data section of the executable, which stores constants (read-only data) | |
; It doesn't matter which order your sections are in, I just like putting .data first | |
section .rodata | |
; Declare some bytes at a symbol called hello_world. NASM's db pseudo-instruction | |
; allows either a single byte value, a constant string, or a combination of the two | |
; as seen here. 0xA = new line, and 0x0 = string-terminating null |