Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for unix domain sockets #680

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

flokli
Copy link
Contributor

@flokli flokli commented Oct 8, 2023

grpc.NewClient already supports connecting to unix domain sockets, and accepts a string anyways.

As a quick fix, detect the address starting with unix:// and don't add the port.

In the long term, we might want to deprecate host and port cmdline args in favor of a single address arg.

Fixes #654.

grpc.NewClient already supports connecting to unix domain sockets, and
accepts a string anyways.

As a quick fix, detect the `address` starting with `unix://` and don't
add the port.

In the long term, we might want to deprecate `host` and `port` cmdline
args in favor of a single `address` arg.
@codecov
Copy link

codecov bot commented Oct 8, 2023

Codecov Report

Merging #680 (55d7e7a) into master (d1bc03a) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #680      +/-   ##
==========================================
+ Coverage   77.10%   77.13%   +0.02%     
==========================================
  Files          57       57              
  Lines        3910     3915       +5     
==========================================
+ Hits         3015     3020       +5     
  Misses        647      647              
  Partials      248      248              

@flokli
Copy link
Contributor Author

flokli commented Nov 6, 2023

@ktr0731 poke ;-)

addr := cfg.Server.Host

// as long as the address doesn't start with unix, also add the port.
if !strings.HasPrefix(cfg.Server.Host, "unix://") {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would personally add --unix switch and use that to decide if we do host:port or just host

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm waiting on @ktr0731 to decide on the path forward.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Poke @ktr0731 @kakke18. Any opinion on this, or reservations against this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: add support for unix domain socket
2 participants