Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make request to Ipv6 address #476

Closed
purugupta99 opened this issue Jan 25, 2022 · 1 comment
Closed

Make request to Ipv6 address #476

purugupta99 opened this issue Jan 25, 2022 · 1 comment

Comments

@purugupta99
Copy link

purugupta99 commented Jan 25, 2022

I've been trying to make a GET request to an IPv6 address but it says invalid url. I've also tried to use square brackets around the IP, in this case it parses the address as a hostname instead of addrInfo.

How do we make a request to an IPv6 address?

@robx
Copy link
Collaborator

robx commented Jan 26, 2022

I can confirm this seems to be broken:

$ host google.com | grep IPv6
google.com has IPv6 address 2a00:1450:4005:802::200e
$ cabal repl
*Network.HTTP.Client> mgr <- newManager defaultManagerSettings
*Network.HTTP.Client> googv6 <- parseRequest "http://[2a00:1450:4005:802::200e]"
*Network.HTTP.Client> httpLbs googv6 mgr
*** Exception: HttpExceptionRequest Request {
  host                 = "[2a00:1450:4005:802::200e]"
  port                 = 80
  secure               = False
  requestHeaders       = []
  path                 = "/"
  queryString          = ""
  method               = "GET"
  proxy                = Nothing
  rawBody              = False
  redirectCount        = 10
  responseTimeout      = ResponseTimeoutDefault
  requestVersion       = HTTP/1.1
  proxySecureMode      = ProxySecureWithConnect
}
 (ConnectionFailure Network.Socket.getAddrInfo (called with preferred socket type/protocol: AddrInfo {addrFlags = [], addrFamily = AF_UNSPEC, addrSocketType = Stream, addrProtocol = 0, addrAddress = 0.0.0.0:0, addrCanonName = Nothing}, host name: Just "[2a00:1450:4005:802::200e]", service name: Just "80"): does not exist (nodename nor servname provided, or not known))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants