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
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion mode/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@ import (
)

func newGRPCClient(cfg *config.Config) (grpc.Client, error) {
addr := fmt.Sprintf("%s:%s", cfg.Server.Host, cfg.Server.Port)
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?

addr = fmt.Sprintf("%s:%s", cfg.Server.Host, cfg.Server.Port)
}

if cfg.Request.Web {
//TODO: remove second arg
return grpc.NewWebClient(addr, cfg.Server.Reflection, false, "", "", "", grpc.Headers(cfg.Request.Header)), nil
Expand Down