Coder Social home page Coder Social logo

Websocket Support about httpie HOT 7 OPEN

GRVYDEV avatar GRVYDEV commented on May 23, 2024 3
Websocket Support

from httpie.

Comments (7)

valentin994 avatar valentin994 commented on May 23, 2024 6

Ok, so right now I have a general implementation where you can send one message or multiple messages until you close it with exit().

Example call for now is:
https WSS ws://127.0.0.1:8000/ws

Now I would ask for some advice/guideance on how the maintainers would like the implementation to be plugged in.

As for now, I have plugged it in the collect_messages() where I read if the method is WSS and then branch it out to go to a function to create a websocket connection and then another function that reads user input in a while loop sends it and waits for another message until the user types in exit(). In the meantime we have a thread that sends pings to keep the connection alive. Now I would have to implement models and leverage the argsparser better.

The question for now is, do I try to plug it into the present client and request handler or do we separate it as websockets are handled differently anyway.

This is the branch https://github.com/valentin994/cli/tree/websocket-support
It is quite crude for now as I am not sure what way we want to go with this.

from httpie.

arguiot avatar arguiot commented on May 23, 2024 1

Would really need this one too!

from httpie.

valentin994 avatar valentin994 commented on May 23, 2024 1

sounds great, would be willing to help with this if needed

from httpie.

jhwheeler avatar jhwheeler commented on May 23, 2024

This would be fantastic!

from httpie.

eyayaw avatar eyayaw commented on May 23, 2024

That would be a great feature. Thank you.

from httpie.

valentin994 avatar valentin994 commented on May 23, 2024

So I started fiddling with it but I would like some pointers from the maintainer on how they would like this implemented.

The request to send requests isn't hard to implement but there are some ways it could be done. Do we want to implement it in a way where someone could specify the number of messages they want to send, what flags should it support, and what should one showcase after a successful connection, I suppose all headers?

As for receiving messages that would be just opening a connection to the wss and listening for messages?

from httpie.

arguiot avatar arguiot commented on May 23, 2024

I think we should be aiming at something similar to websocat

from httpie.

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.