Show HN: ProtoCURL, a curl for Protobuf

  • Inside Google (where everything is protobuf) there were a handful of tools like this. But the killer feature is that there was an automatically-added RPC service for introspecting the other RPC services any given server exposed. This means that there was an `ls` command for listing possible services, methods on those services and the protocol buffers for the request and response. So you didn't need to manage the source protos. You could just do something like `protocurl 10.1.2.3 MyService.MyMethod 'foo: 8 bar: "foo"'` and it put all of the pieces together.

    The introspection could be a little slow if the server was far away (it added a couple round trips) but the ability to avoid knowing where the schemas were was invaluable. (I wonder if there could have also been some sort of caching to make it a bit better).

  • I’ve used a similar tool a bit that did what I needed.

    gRPCurl, Like cURL, but for gRPC: Command-line tool for interacting with gRPC servers

    https://github.com/fullstorydev/grpcurl

    The readme in your link mentions how they are different:

    > How is protocurl different from grpccurl? grpccurl only works with gRPC services with corresponding endpoints. However, classic REST HTTP endpoints with binary Protobuf payloads are only possible with protocurl.

    For my purposes, gRPCurl was a good fit. Maybe to others as well.

  • Pretty cool, but if you like a gui, I'd highly recommend https://github.com/fullstorydev/grpcui, lightweight and super easy to use

  • nice. A lot of the problems people have with protobuf are down to deficiency in the opensource tooling.

    For example, I miss an easy way to stuff all my (and my team's) protobufs in a registry and a tool that autodetects what schema a protobuf is (or leverages the type in Any), so that I can avoid passing complicated path flags to all these tools that decode protos.

    Any ideas?

  • I used `protoc --encode` (and `--decode`) to do something similar. Didn't send it over HTTP but piped it to MQTT or serial ports.

    Unfortunately, those options are poorly documented, so it took me some time to figure that out.

  • if any interested, I also have a black box ProtoBuf package:

    http://2a.pages.dev/rosso

  • mitmproxy also has some nice tools for working with raw protobufs.