Friday, November 20, 2009

CouchDB ... with IPv6?!

... brute force grepping on the CouchDB source code seems to reveal there is IPv6 in CouchDB. Now I have to find out how to enable it ...

UPDATE:

Thanks to JanL's comment, my CouchDB instance now works over IPv6 (::1):

I added the IPv6 localhost address ::1 to "bind_address" in /etc/couchdb/local.ini, like this:



[httpd]
;port = 5984
;bind_address = 127.0.0.1
bind_address = ::1


After a restart, CouchDB now listens on http://[::1]:5984/_utils/



UPDATE 2:

I added :: to "bind_address" in /etc/couchdb/local.ini, like this:



[httpd]
;port = 5984
;bind_address = 127.0.0.1
bind_address = ::


After a restart, CouchDB now listens on the public IPv6 address! Great!



sander@quirinius:~/apache-couchdb-0.10.0$ egrep -i -e inet6 -e inet4 -e inet6fb4 -e ipv6 * */* */*/* */*/*/* */*/*/*/*
CHANGES: * CouchDB can now be bound to IPv6 addresses.
src/mochiweb/mochiweb_socket_server.erl:ipv6_supported() ->
src/mochiweb/mochiweb_socket_server.erl:    case (catch inet:getaddr("localhost", inet6)) of
src/mochiweb/mochiweb_socket_server.erl:            case ipv6_supported() of % IPv4, and IPv6 if supported
src/mochiweb/mochiweb_socket_server.erl:                true -> [inet, inet6 | BaseOpts];
src/mochiweb/mochiweb_socket_server.erl:        {_, _, _, _, _, _, _, _} -> % IPv6
src/mochiweb/mochiweb_socket_server.erl:            [inet6, {ip, Ip} | BaseOpts]
sander@quirinius:~/apache-couchdb-0.10.0$

2 comments:

JanL said...

just set the ip address to listen to to your ipv6 address in your local.ini file.

Quirinius said...

Thanks, JanL: that works. I'll update my post.