No description
Find a file
2024-11-26 16:56:58 +08:00
.github/workflows bump to devel 2023-04-06 13:14:00 +08:00
experiment clean 2020-10-05 19:20:33 +08:00
src Allow custom socket (systemd socket activation...) (#31) 2023-07-31 10:22:54 +08:00
tests Add tests and implement allowing unknown length 2022-11-26 16:54:43 +11:00
.gitignore tests 2020-08-12 18:14:04 +08:00
.travis.yml go 2020-08-07 11:36:46 +08:00
azure-pipelines.yml go 2020-08-07 11:36:46 +08:00
httpbeast.LICENSE done 2020-08-09 07:11:00 +08:00
httpx.nimble bump to 0.3.8 (#37) 2024-11-26 16:56:58 +08:00
LICENSE Initial commit 2020-08-04 16:18:07 +08:00
README.md fixes names (#34) 2023-09-28 17:08:11 +08:00

httpx

This project is based on Dom96's perfect work on httpbeast and adds windows support(based on wepoll namely IOCP).

It is also used by prologue.

Installation

nimble install httpx

Notes

Notes that multi-threads may be slower than single-thread!

Usage

Change server info name

-d:serverInfo:serverName

Enable threads

--threads:on

Hello world

import options, asyncdispatch

import httpx

proc onRequest(req: Request): Future[void] =
  if req.httpMethod == some(HttpGet):
    case req.path.get()
    of "/":
      req.send("Hello World")
    else:
      req.send(Http404)

run(onRequest)

Websocket support

https://github.com/ringabout/websocketx

nimble install https://github.com/ringabout/websocketx