1
0
mirror of https://github.com/go-micro/go-micro.git synced 2024-11-24 08:02:32 +02:00

Add Local/Remote ip to metadata

This commit is contained in:
Asim Aslam 2018-11-14 20:27:58 +00:00
parent 3c496720cc
commit 0672b051cc

View File

@ -97,6 +97,10 @@ func (s *rpcServer) accept(sock transport.Socket) {
delete(hdr, "Content-Type")
delete(hdr, "Timeout")
// set local/remote ips
hdr["Local"] = sock.Local()
hdr["Remote"] = sock.Remote()
ctx := metadata.NewContext(context.Background(), hdr)
// set the timeout if we have it