0

I'm writing a thrift service in golang and I would like to understand how I can get the client's IP address in the handler functions context.

Thanks, Love.

1 Answers1

1

I think you're using this Godoc Thrift library. It would be good to have code snippets in your question; such as type of thrift server, handler definition, etc.

As per Thrift Go library doc-

func (p *TSocket) Addr() net.Addr

Returns the remote address of the socket.

So if you have access to TSocket then you can get remote address.

Community
  • 1
  • 1
jeevatkm
  • 4,571
  • 1
  • 23
  • 24