daurnimator / lua-http

HTTP Library for Lua. Supports HTTP(S) 1.0, 1.1 and 2.0; client and server.
https://daurnimator.github.io/lua-http/
MIT License
778 stars 80 forks source link

server_hello.lua #205

Closed Vincent-vst closed 1 year ago

Vincent-vst commented 1 year ago

I can't seem to run server_hello.lua in the example folder.

$ lua server.lua 8888
lua: server.lua:56: The name does not resolve for the supplied parameters
stack traceback:
    [C]: in function 'assert'
    server.lua:56: in main chunk
    [C]: in ?

same with no parameters

lua server.lua
lua: server.lua:56: The name does not resolve for the supplied parameters
stack traceback:
    [C]: in function 'assert'
    server.lua:56: in main chunk
    [C]: in ?

I don't know what am I doing wrong

daurnimator commented 1 year ago

I don't know what am I doing wrong

https://github.com/daurnimator/lua-http/blob/169c1a7586d39be1bf0d98b69934e8e8b08a87cd/examples/server_hello.lua#L43

I would expect the issue is that your local DNS resolver doesn't return anything for localhost

Vincent-vst commented 1 year ago

Yup, you were right, I replaced it with 127.0.0.1 and it's now working ! Thank you