diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..4c7fd6ad --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,11 @@ +{ + "name": "Lightbug HTTP (Linux)", + "image": "ghcr.io/prefix-dev/pixi:latest", + "postCreateCommand": "apt-get update && apt-get install -y git && pixi install", + "forwardPorts": [8080], + "customizations": { + "vscode": { + "extensions": ["modular-mojotools.vscode-mojo"] + } + } +} diff --git a/lightbug_http/connection.mojo b/lightbug_http/connection.mojo index f00ca52d..47c28d23 100644 --- a/lightbug_http/connection.mojo +++ b/lightbug_http/connection.mojo @@ -239,14 +239,11 @@ struct ListenConfig: except socket_err: raise SocketCreationError() - @parameter - # TODO: do we want to add SO_REUSEPORT on linux? Doesn't work on some systems - if CompilationTarget.is_macos(): - try: - socket.set_socket_option(SocketOption.SO_REUSEADDR, 1) - except sockopt_err: - # Socket option failure is not fatal, just continue - pass + try: + socket.set_socket_option(SocketOption.SO_REUSEADDR, 1) + except sockopt_err: + # Socket option failure is not fatal, just continue + pass var addr = TCPAddr[network](ip=local.host^, port=local.port) var bind_success = False