Support for raw IPv6 addresses in http package (Tcl 8.6!)



Folks!

I am trying to put my hands dirty on IPv6. My goal is to be able to talk to sensors (and actuators) in IPv6-only sensor networks. The sensors run an IPSO interop inspired profile, which in short means REST/json constructs. That was for the background, now to my question.

Is there anyone who has been able to modify the code of the http package from the core so that it can support raw IP addresses, e.g. 2001:5c0:1400:b::d623 to take my current address as an example. I've checked in the latest version at core.tcl.tk and the implementation of ::http::geturl still starts with a URL validation that is based on a regexp that does NOT support raw addresses as the one above (they should be enclosed in brackets in URLs). The problem is that the atom of the regexp that should match the host part of the authority is written as [^/:\#?]+ which will not work since IPv6 addresses are written using : as separators (well, not entirely true, but almost). I have been trying to merge the code from this "super" IPv6 matcher regexp without any success: http://forums.intermapper.com/viewtopic.php?t=452.

Anyone with a solution or a better idea?

/Emmanuel
.