Problem getting HTTP.Websocket Server example working

I am using the canonical HTTP.WebSockets example but getting an iterator error on ws.

    using HTTP.WebSockets

    WebSockets.listen(host, convert(UInt16, port)) do ws
        for message in ws
            @show message
            #send(ws, msg)
        end
    end
┌ Error: error handling request
│   exception =
│    MethodError: no method matching iterate(::HTTP.WebSockets.WebSocket{HTTP.ConnectionPool.Transaction{Sockets.TCPSocket}})
│    Closest candidates are:
│      iterate(::Union{LinRange, StepRangeLen}) at range.jl:872
│      iterate(::Union{LinRange, StepRangeLen}, ::Integer) at range.jl:872
│      iterate(::T) where T<:Union{Base.KeySet{<:Any, <:Dict}, Base.ValueIterator{<:Dict}} at dict.jl:712
│      ...
│    Stacktrace:
│     [1] (::Main.Tibra.var"#43#44")(ws::HTTP.WebSockets.WebSocket{HTTP.ConnectionPool.Transaction{Sockets.TCPSocket}})
│       @ Main.Tibra ~/src/tibra/Tibra.jl/src/tibrax_server/ws_server.jl:19
│     [2] upgrade(f::Main.Tibra.var"#43#44", http::HTTP.Streams.Stream{HTTP.Messages.Request, HTTP.ConnectionPool.Transaction{Sockets.TCPSocket}}; binary::Bool)
│       @ HTTP.WebSockets ~/.julia/packages/HTTP/aTjcj/src/WebSockets.jl:160
│     [3] (::HTTP.WebSockets.var"#6#7"{Bool, Main.Tibra.var"#43#44"})(http::HTTP.Streams.Stream{HTTP.Messages.Request, HTTP.ConnectionPool.Transaction{Sockets.TCPSocket}})
│       @ HTTP.WebSockets ~/.julia/packages/HTTP/aTjcj/src/WebSockets.jl:136
│     [4] macro expansion
│       @ ~/.julia/packages/HTTP/aTjcj/src/Servers.jl:415 [inlined]
│     [5] (::HTTP.Servers.var"#13#14"{HTTP.WebSockets.var"#6#7"{Bool, Main.Tibra.var"#43#44"}, HTTP.ConnectionPool.Transaction{Sockets.TCPSocket}, HTTP.Servers.Server{Nothing, Sockets.TCPServer}, HTTP.Streams.Stream{HTTP.Messages.Request, HTTP.ConnectionPool.Transaction{Sockets.TCPSocket}}})()
│       @ HTTP.Servers ./task.jl:484
└ @ HTTP.Servers ~/.julia/packages/HTTP/aTjcj/src/Servers.jl:429

Can you double check what version you’re on? It seems like maybe you’re stuck on an old one before this was defined?

Yea that must be it. How do I sync the Manifest and remove the outdated dep of WebSockets?


(Tibra.jl) pkg> status HTTP
Status `~/src/tibra/Tibra.jl/Project.toml`
⌅ [cd3eb016] HTTP v0.9.17
Info Packages marked with ⌅ have new versions available but compatibility constraints restrict them from upgrading. To see why use `status --outdated`

(Tibra.jl) pkg> status --outdated HTTP
Status `~/src/tibra/Tibra.jl/Project.toml`
⌅ [cd3eb016] HTTP v0.9.17 (<v1.7.4): Mux, WebSockets

(Tibra.jl) pkg> remove WebSockets
ERROR: The following package names could not be resolved:
 * WebSockets (104b5d7c-a370-577a-8038-80a2059c5097 in manifest but not in project)

(Tibra.jl) pkg> remove Mux
ERROR: The following package names could not be resolved:
 * Mux (a975b10e-0019-58db-a62f-e48ff68538c9 in manifest but not in project)

I had to remove Blink.jl as apparently its using outdated libraries.

Mux has a newer version that supports HTTP 1.0. Ah, I see you just replied about Blink.jl.