GNOME Bugzilla – Bug 522519
soup-server ipv6 support
Last modified: 2014-05-02 13:19:06 UTC
It would be nice if soup-server could listen on ipv6 addresses too.
You *can* listen on ipv6 if you tell it to explicitly. Instead of doing: server = soup_server_new (SOUP_SERVER_PORT, port, NULL); do addr = soup_address_new (SOUP_ADDRESS_FAMILY_IPV6, port); server = soup_server_new (SOUP_SERVER_INTERFACE, addr, NULL); g_object_unref (addr); However, it would be nice if there was an easier way. It should probably also be possible to have a single SoupServer listening on multiple ports, so that you can have one SoupServer serving both IPv4 and IPv6, rather than needing two servers with the same handlers attached to them. (This could also be used to enable http and https from a single server.)
Oh, sorry. I think it's an enhancement, then. :)
I agree. Such feature would be very nice.
Dear Dan, libsoup cannot listen on IPv6 link local address. This bug is mostly because GSocketAddress does not have a field for "sin6_scope_id" to fill in interface index (as stated in man 7 ipv6). Libsoup is used in GUPnP. UPnP standard requires to support link local addresses as well. I was wondering how to proceed further. How to go about solving this one? Regards, VJ
fixed in git master (In reply to comment #1) > However, it would be nice if there was an easier way. It should probably also > be possible to have a single SoupServer listening on multiple ports, so that > you can have one SoupServer serving both IPv4 and IPv6, rather than needing two > servers with the same handlers attached to them. (This could also be used to > enable http and https from a single server.) This is possible via the new soup_server_listen_* APIs. Eg, to listen on port 9999 on localhost on both IPv4 and IPv6, do: soup_server_listen_local (server, 9999, 0, &error); or for just IPv6: soup_server_listen_local (server, 9999, SOUP_SERVER_LISTEN_IPV6_ONLY, &error); (In reply to comment #4) > libsoup cannot listen on IPv6 link local address. This bug is mostly because > GSocketAddress does not have a field for "sin6_scope_id" to fill in interface > index (as stated in man 7 ipv6). GInetSocketAddress was fixed a while back to support scope_id. So to do this, you can now create a GInetSocketAddress with the appropriate scope_id, and then pass that address to soup_server_listen()