# Problem getting HTTP.Websocket Server example working

**URL:** https://discourse.julialang.org/t/problem-getting-http-websocket-server-example-working/97801
**Category:** General Usage
**Created:** [April 23, 2023, 3:16am UTC](https://discourse.julialang.org/t/problem-getting-http-websocket-server-example-working/97801 "2023-04-23T03:16:53Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![bryaan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bryaan/32/36858_2.png) [@bryaan](https://discourse.julialang.org/u/bryaan)
#### Post date: [April 23, 2023, 3:16am UTC](https://discourse.julialang.org/t/problem-getting-http-websocket-server-example-working/97801/1 "2023-04-23T03:16:53Z")

</div>

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

```julia
    using HTTP.WebSockets

    WebSockets.listen(host, convert(UInt16, port)) do ws
        for message in ws
            @show message
            #send(ws, msg)
        end
    end

```

```julia
┌ 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

```

---

<div class="post-metadata">

### Author: ![quinnj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/quinnj/32/11_2.png) [@quinnj](https://discourse.julialang.org/u/quinnj)
#### Post date: [April 23, 2023, 3:29am UTC](https://discourse.julialang.org/t/problem-getting-http-websocket-server-example-working/97801/2 "2023-04-23T03:29:10Z")

</div>

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

---

<div class="post-metadata">

### Author: ![bryaan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bryaan/32/36858_2.png) [@bryaan](https://discourse.julialang.org/u/bryaan)
#### Post date: [April 23, 2023, 3:48am UTC](https://discourse.julialang.org/t/problem-getting-http-websocket-server-example-working/97801/3 "2023-04-23T03:48:20Z")

</div>

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

```julia

(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)

```

---

<div class="post-metadata">

### Author: ![bryaan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bryaan/32/36858_2.png) [@bryaan](https://discourse.julialang.org/u/bryaan)
#### Post date: [April 23, 2023, 3:54am UTC](https://discourse.julialang.org/t/problem-getting-http-websocket-server-example-working/97801/4 "2023-04-23T03:54:39Z")

</div>

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

---

<div class="post-metadata">

### Author: ![quinnj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/quinnj/32/11_2.png) [@quinnj](https://discourse.julialang.org/u/quinnj)
#### Post date: [April 23, 2023, 3:56am UTC](https://discourse.julialang.org/t/problem-getting-http-websocket-server-example-working/97801/5 "2023-04-23T03:56:11Z")

</div>

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