Created
          August 25, 2011 06:05 
        
      - 
      
- 
        Save ukstudio/1170083 to your computer and use it in GitHub Desktop. 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | require 'net/http' | |
| uri = URI.parse('http://[::1]:3000') | |
| puts uri.host #=> '[::1]' | |
| puts uri.hostname #=> '::1' | |
| Net::HTTP.start(uri.host, uri.port) do |http| | |
| http.get('/') | |
| end #=> getaddrinfo: Name or 2 vice not known (SocketError) | |
| Net::HTTP.start(uri.hostname, uri.port) do |http| | |
| http.get('/') | |
| end #=> #<Net::HTTPOK.. | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment