Giter Club home page Giter Club logo

Comments (10)

elithrar avatar elithrar commented on May 18, 2024 1

from mux.

jeniasaigak avatar jeniasaigak commented on May 18, 2024 1

Just had the same issue. In my case, it was not related to the library. I just missed the fact that I had another route before this one which took the request:

r.HandleFunc("/some/path/{id}", a.route) // takes the /**/ws request instead of the needed handler
r.HandleFunc("/some/path/ws", a.wsRoute)

Changing lines order solved the issue for me 🙈

from mux.

kisielk avatar kisielk commented on May 18, 2024

I don't see any obvious reasons why it should not work. Can you provide any more details? Are you sure the client is going specifically to the /ws URL and not a sub-path thereof? The gorilla mux example will return 404 for anything that's not exactly /ws or /

from mux.

tchap avatar tchap commented on May 18, 2024

Even

r.PathPrefix("/ws").Handler(ws.Server{
        Handshake: s.handleWSHandshake,
        Handler:   s.handleWSConnection,
})

is not working. It's giving me GET /ws -> 404.

from mux.

kisielk avatar kisielk commented on May 18, 2024

Do you have the actual code available somewhere, to provide a runnable example?

from mux.

longsleep avatar longsleep commented on May 18, 2024

Gorilla works fine with /ws handler for us. See https://github.com/strukturag/spreed-speakfreely/blob/master/src/app/spreed-speakfreely-server/main.go#L309 - i guess this can be closed.

from mux.

kisielk avatar kisielk commented on May 18, 2024

Yeah, I've seen other people using it successfully. Please reopen if there is a specific example of it not working.

from mux.

bipin244 avatar bipin244 commented on May 18, 2024

Can anyone please share a working example of WebSocket with gorilla mux?

from mux.

elithrar avatar elithrar commented on May 18, 2024

from mux.

bipin244 avatar bipin244 commented on May 18, 2024

Okay thank my friend.

from mux.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.