Giter Site home page Giter Site logo

Comments (7)

jkbrzt avatar jkbrzt commented on August 15, 2024

Sounds good, anything needed from HTTTPie?

from httpie-unixsocket.

msabramo avatar msabramo commented on August 15, 2024

@jkbrzt: Question: Is it possible for an HTTPie transport plugin to support multiple prefixes? E.g.:

class UnixSocketTransportPlugin(TransportPlugin):
    name = 'UNIX socket transport'

    prefix = ['http://sock.local/', 'http+unix://']

    def get_adapter(self):
        return UnixAdapter()

Because I have a new scheme that I'm playing with, but I thought it would be nice to support the old prefix too. Though maybe I shouldn't worry too much about it, since the version number is < 1 and thus arguably, people should be willing to accept breaking changes.

from httpie-unixsocket.

jkbrzt avatar jkbrzt commented on August 15, 2024

@msabramo the plugin API currently only supports one prefix per plugin. But you could, for example, expose two plugins (differing only in the prefix) in setup.py, e.g.:

    entry_points={
        'httpie.plugins.transport.v1': [
            'httpie_unixsocket = httpie_unixsocket:UnixSocketTransportPlugin',
            'httpie_unixsocket_legacy = httpie_unixsocket:LegacyUnixSocketTransportPlugin',
        ]
    },

from httpie-unixsocket.

graingert avatar graingert commented on August 15, 2024

you can't use sock.local

".local" is the domain used to advertise with multicast DNS.

you need to use a subdomain of your own domain name.

from httpie-unixsocket.

msabramo avatar msabramo commented on August 15, 2024

@jkbrzt: Thanks! Yeah that's what I was starting to think of as well after I posted my comment. Not a bad option. Although I might end up not needing it, because folks seem to be wanting to keep the http+unix:// protocol, in which case I could get by with just one plugin object.

from httpie-unixsocket.

msabramo avatar msabramo commented on August 15, 2024

Note: I have begun working on this in msabramo/requests-unixsocket#34

from httpie-unixsocket.

msabramo avatar msabramo commented on August 15, 2024

Thanks, @graingert! Yeah a few people have mentioned that; I wasn't aware that .local has special meaning; good to know! And I see you found and commented on msabramo/requests-unixsocket#34, which is great, because that's where all that discussion is happening.

from httpie-unixsocket.

Related Issues (8)

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.