Search code examples
rubythriftunix-socket

Can unix socket be used for thrift ruby client?


I'm trying to use thrift, and use ruby as client side. I'm trying to find documentation for how to initialize a ruby client using the unix domain socket.

Is it possible to use thrift on ruby client and use unix domain socket?


Solution

  • Yes. Instead of Thrift::Socket you use:

    Thrift::UNIXSocket.new('/path/to/socket')
    

    https://github.com/apache/thrift/blob/master/lib/rb/lib/thrift/transport/unix_socket.rb