Make sure to check out our launch blog post.

Currently, only Go language bindings exist for the drpc wire protocol, though bindings for other languages should be exceptionally straightforward.

Go Quickstart

First, make sure your protocol buffer file is defined:

syntax = "proto3";

option go_package = "example/sesamestreet";

package sesamestreet;

message Cookie {
  enum Type {
    Sugar = 0;
    Oatmeal = 1;
    Chocolate = 2;

  Type type = 1;

message Crumbs {
  Cookie cookie = 1;

service CookieMonster {
  rpc EatCookie(Cookie) returns (Crumbs) {}

Place protoc-gen-go-drpc in your $PATH and have protoc generate your definitions:

$ go get
$ protoc --go_out=. --go_opt=paths=source_relative \
         --go-drpc_out=. --go-drpc_opt=paths=source_relative \
$ ls
sesamestreet_drpc.pb.go sesamestreet.pb.go sesamestreet.proto

Next, define your server code:

type CookieServer struct {

func (c *CookieServer) EatCookie(ctx context.Context, cookie *sesamestreet.Cookie) (
  crumbs *sesamestreet.Crumbs, err error) {
  log.Println("nom nom nom")
  return &sesamestreet.Crumbs{
    Cookie: cookie,
  }, nil

func Serve(ctx context.Context, address string) error {
  m := drpcmux.New()
  lis, err := net.Listen("tcp", address)
  if err != nil {
    return err
  defer lis.Close()
  err = sesamestreet.DRPCRegisterCookieMonster(m, &CookieServer{})
  if err != nil {
    return err
  return drpcserver.New(m).Serve(ctx, lis)

Last, define your client code:

func CookieTime(ctx context.Context, address string) error {
  rawconn, err := net.Dial("tcp", address)
  if err != nil {
    return err
  conn := drpcconn.New(rawconn)
  defer conn.Close()

  client := sesamestreet.NewDRPCCookieMonsterClient(conn)
  crumbs, err := client.EatCookie(ctx, &sesamestreet.Cookie{
    Type: sesamestreet.Cookie_Oatmeal,
  return err

You're done! Yum!

If you'd like to see more examples of usage in different contexts, such as DRPC and gRPC side by side, the HTTP/JSON gateway, or others, make sure to check out our other examples.