We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import options, asyncdispatch import httpx, net proc onRequest(req: Request): Future[void] {.async.} = # Log the incoming request echo "Received request: ", req.httpMethod.get(), " ", req.path if req.httpMethod == some(HttpGet): case req.path.get() of "/": req.send("Hello World") echo "Sent response: Hello World" else: req.send(Http404) echo "Sent response: 404 Not Found" let settings = Settings( port: Port(80), bindAddr: "::", # IPv6 address listener: newSocket(AF_INET6, SOCK_STREAM, IPPROTO_IPV6) ) # Start the server and log that it's running echo "Starting server on port ", settings.port run(onRequest, settings) echo "Server is running"
error
/Users/of/Work/Nim/web_test/ssr_test/src/serverv6.nim(22) serverv6 /Users/of/.choosenim/toolchains/nim-2.2.0/lib/pure/net.nim(309) newSocket /Users/of/.choosenim/toolchains/nim-2.2.0/lib/std/oserrors.nim(92) raiseOSError Error: unhandled exception: Bad file descriptor [OSError]
The text was updated successfully, but these errors were encountered:
No branches or pull requests
error
The text was updated successfully, but these errors were encountered: