warden/lib/warden/container/insecure.rb
# Nothing has to be done to map an external port to an insecure
# container. The container lives in the same kernel namespaces as all
# other processes, so it has to share its ip space them. To make it more
# likely for a process inside the insecure container to bind to this
# inbound port, we grab and return an ephemeral port.
Nothing has to be done to map an external port to an insecure
container. The container lives in the same kernel namespaces as all
other processes, so it has to share its ip space them. To make it more
likely for a process inside the insecure container to bind to this
inbound port, we grab and return an ephemeral port.
Nothing has to be done to map an external port to an insecure container . The container lives in the same kernel namespaces as all other processes so it has to share its ip space them . To make it more likely for a process inside the insecure container to bind to this inbound port we grab and return an ephemeral port .
def do_net_in
        socket = TCPServer.new("0.0.0.0", 0)
        socket.setsockopt(Socket::SOL_SOCKET, Socket::SO_REUSEADDR, 1)
        socket.do_not_reverse_lookup = true
        port = socket.addr[1]
        socket.close
        port
      end
def do_net_in socket = TCPServer . new ( "0.0.0.0" , 0 ) socket . setsockopt ( Socket :: SOL_SOCKET , Socket :: SO_REUSEADDR , 1 ) socket . do_not_reverse_lookup = true port = socket . addr [ 1 ] socket . close port end
Nothing has to be done to map an external port to an insecure
container.
Nothing has to be done to map an external port to an insecure container .