Skip to content

[Enhancement] Allow custom path and stream name for gRPC #1793

@HirbodBehnam

Description

@HirbodBehnam

We had a talk with @RPRX in #1790 about allowing custom paths in gRPC transport.
There is a recap of our idea.

  1. We can assign custom stream names for Tun and TunMulti. These strings are currently hardcoded here. Changing them shouldn't be a big deal.
  2. Allow user to use absolute paths for gRPC. This can be determined from the prefix of / in serviceName. But this will bring us a problem. How we are going to distinguish traffic with multiMode set and not set?

I think implementing 1 is pretty simple and straight-forward. For 2, we can do this:

  1. Check if serviceName has / suffix. If it does not have one, just act like before.
  2. If it does have, we don't path escape the serviceName. Instead, we will use absolute path defined in the serviceName + the custom Tun and TunMulti stream name. For example if the serviceName is set to /my/path and our custom Tun stream name is customTun, we will send our request to www.hostname.com/my/path/customTun. On the client side, this looks easy to implement. The implementation should take place in this file again. However, on the server side we should make sure that the gRPC library does support paths as its service name.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions