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

Add support for IPv6 litteral addresses #23

Open
vbmithr opened this issue Sep 2, 2013 · 8 comments
Open

Add support for IPv6 litteral addresses #23

vbmithr opened this issue Sep 2, 2013 · 8 comments
Milestone

Comments

@vbmithr
Copy link
Member

vbmithr commented Sep 2, 2013

http://[::1] can be transformed from and to string for example.

@avsm
Copy link
Member

avsm commented Oct 15, 2013

I think @mor1 made some progress on an ipv6 parser in ocaml...

@mor1
Copy link
Member

mor1 commented Oct 16, 2013

somewhere. wasn't complete though. can't recall if it was in the repo or not. i'll have a look...

@avsm
Copy link
Member

avsm commented Jan 16, 2014

related to mirage/ocaml-ipaddr#9

@dsheets
Copy link
Member

dsheets commented Jan 16, 2014

I thought a pretty minimal regex parser for this made it in a while ago...

This will happen after it gets into ocaml-ipaddr which will take it to 2.0. Then, ocaml-ipaddr will become a dep of ocaml-uri when The Coming Reckoning finally fixes the Uri interface in 2.0.

@avsm
Copy link
Member

avsm commented Jun 16, 2014

This works pretty well with Ipaddr atm; do we really need it in URI?

Ipaddr.of_string (match Uri.host (Uri.of_string "http://[::1]") with |Some i -> i |None -> failwith "");;
- : Ipaddr.t option = Some ::1 

@dsheets
Copy link
Member

dsheets commented Jun 16, 2014

I think there is some place for a type that sums addresses and host names. End users shouldn't (necessarily) have to consider that the host string that they get back may not need name resolution. I was imagining something like:

type host = Ipaddr of Ipaddr.t | Host of string

val host : t -> host option
val host_string : t -> string option

where host_string is the present host. Perhaps this is unnecessary, though, as you indicate...

@dsheets dsheets added this to the 2.0 milestone Feb 7, 2015
@edwintorok
Copy link

Did 'Uri' regress this behaviour? The example from above #23 (comment) no longer works, it doesn't parse RFC conforming IPv6 addresses anymore:

utop # Uri.of_string "http://[::1]" |> Uri.host;;
- : string option = Some ""
utop # Uri.of_string "http://[::1]" |> Uri.path;;
- : string = "%5B::1%5D"

@anmonteiro
Copy link
Contributor

#169

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

No branches or pull requests

6 participants