Closed hacker-DOM closed 1 month ago
Consider this code:
local http_server = hs.httpserver.new(false, false) -- ssl, bonjour local function handle_request(method, path) print("Received request:", method, path) return 200, "Success", "text/plain" end http_server:setPort(1234):setName("test"):setCallback(handle_request):start()
When I go to http://localhost:1234, I would expect to see the log, but nothing happens.
http://localhost:1234
I believe this should show me whether a program is listening on port 1234
❯ lsof -P -iTCP:1234 -sTCP:LISTEN
but again it is empty.
I am on Macos @ 14.6.1 and Hammerspoon @ 0.9.97. Maybe I have to give Hammerspoon additional permissions or something (I couldn't find anything).
Thank you!
It was being garbage collected.
Consider this code:
When I go to
http://localhost:1234
, I would expect to see the log, but nothing happens.I believe this should show me whether a program is listening on port 1234
but again it is empty.
I am on Macos @ 14.6.1 and Hammerspoon @ 0.9.97. Maybe I have to give Hammerspoon additional permissions or something (I couldn't find anything).
Thank you!