mirror of
https://github.com/linka-cloud/grpc.git
synced 2025-06-22 09:12:28 +00:00
add unix socket support
Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
This commit is contained in:
@ -145,7 +145,13 @@ func (s *service) run() error {
|
||||
return err
|
||||
}
|
||||
|
||||
lis, err := net.Listen("tcp", s.opts.address)
|
||||
network := "tcp"
|
||||
if strings.HasPrefix(s.opts.address, "unix://") {
|
||||
network = "unix"
|
||||
s.opts.address = strings.TrimPrefix(s.opts.address, "unix://")
|
||||
}
|
||||
|
||||
lis, err := net.Listen(network, s.opts.address)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
Reference in New Issue
Block a user