Skip to content

Commit

Permalink
get actual hostname for localhost (needed for Windows)
Browse files Browse the repository at this point in the history
  • Loading branch information
tagomoris committed Dec 20, 2016
1 parent c9ab7a7 commit c1626d2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/plugin/test_in_forward.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ def teardown
port #{PORT}
bind 127.0.0.1
]
DUMMY_SOCK = Struct.new(:remote_host, :remote_addr, :remote_port).new("localhost", "127.0.0.1", 0)
LOCALHOST_HOSTNAME_GETTER = ->(){sock = UDPSocket.new(::Socket::AF_INET); sock.do_not_reverse_lookup = false; sock.connect("127.0.0.1", 2048); sock.peeraddr[2] }
DUMMY_SOCK = Struct.new(:remote_host, :remote_addr, :remote_port).new(LOCALHOST_HOSTNAME_GETTER.call, "127.0.0.1", 0)
CONFIG_AUTH = %[
port #{PORT}
bind 127.0.0.1
Expand Down

0 comments on commit c1626d2

Please sign in to comment.