I am trying to deploy a web-socket server which accepts non-TLS websocket connection request (i.e. “ws://” instead of “wss://”).
The server when run locally accepts non-tls requests but when deployed on fly.io, only accepts TLS connections.
fly.toml :
# fly.toml file generated for quiet-star-6957 on 2023-03-16T18:59:11+05:30
app = "quiet-star-6957"
primary_region = "bos"
[build]
dockerfile = "Dockerfile"
[[services]]
internal_port = 8080
protocol = "tcp"
[services.concurrency]
hard_limit = 25
soft_limit = 20
[[services.ports]]
handlers = ["http"]
port = "80"
[[services.ports]]
handlers = ["tls", "http"]
port = "443"
[[services.tcp_checks]]
interval = 10000
timeout = 2000
I also tried a potential solution mentioned here where
tls_options = { "alpn" = ["h2"] }
was added in [[services.ports]] under the “tls” handler.
But, still received the HTTP 426 error.
Thanks!