about

tiny web chat application in pure c

current features:

  • http server
  • websocket server (based on RFC 6455)
  • SSL support with openSSL for https and wss
  • IPv6 support
  • MIME support: html/htm, jpg/jpeg, png, css, ico
  • PostgreSQL support (with postgresql library)
  • hashing and salting of passwords

install && run:

make WITH_DB=0 LOG_ON=1 DEBUG=0&& ./server <HOST> <PORT> <FLAGS> 

with SSL

  1. generate private key:
    openssl genrsa -out key.pem 2048
    
  2. create a CSR
    openssl req -new -key key.pem -out csr
    
  3. create a self-signed certificate
    openssl x509 -req -in csr -signkey key.pem -out cert.pem -days 365
    
  4. use --SSL option to enable https and wss

with PostgreSQL

  1. install postgresql lib.
  2. create conninfo file and fill in connection information
  3. compile with WITH_DB=1