Skip to content

allow-local-unix-socket #404

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

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
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
3 changes: 3 additions & 0 deletions lib/grpc/server/adapters/cowboy.ex
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,9 @@ defmodule GRPC.Server.Adapters.Cowboy do
:undefined ->
raise "undefined address for ranch server"

:local ->
Copy link
Contributor

Choose a reason for hiding this comment

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

As with the other PR, please add tests for the change.

Copy link
Contributor

Choose a reason for hiding this comment

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

I believe when using :local, the handling of the address would be a bit different as it needs the socket file returned in port to decide which is the unix file descriptor handling the connection

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, seeing as this is only used in logs, we can perhaps add that info to Logger.metadata and return "local" as it is now.

"local"

addr ->
"#{:inet.ntoa(addr)}:#{port}"
end
Expand Down