IPv6 support #70

indeyets opened this Issue Jun 11, 2011 · 8 comments


None yet
5 participants

web.net.validip() function doesn't know anything about IPv6 addresses.

This function is used to validate binding address of http-server, which is started by web.py. So, currently, it is not possible to run this http-server over IPv6 network.

Similar report on Ubuntu's launchpad: https://bugs.launchpad.net/webpy/+bug/348385


mnakama commented Dec 12, 2012

Here's a patch I just made to enable ipv6. It uses python's socket library to validate the ipv6 address. Testing shows that you can run your program like this:

./mywebserver.py [::]:8085

And it will bind to IPv6. IPv4 connections will show up as: ::ffff: when I tried this.

Now, if only I looked in github before I dug through the source to find that all that had to be changed was net.py =)

Patch: http://pastebin.com/zeeuXMkX (See newer post)

I emailed it to Aaron Swartz as well. If I should post this somewhere specific, please let me know. I'm a git/github newbie...


zamabe commented Dec 12, 2012

Should specify socket.error in exception catching.


mnakama commented Dec 12, 2012

Ah, good catch. Thanks for the code review. Here's the new ipv6 patch with socket.error:



aaronsw commented Dec 12, 2012

Can you submit it as a pull request?

zamabe referenced this issue Dec 12, 2012


Add IPv6 support #195

negly commented Dec 12, 2012

What is this?, i am new in this, help me!
Enviado desde mi BlackBerry de Movistar

-----Original Message-----
From: Aaron Swartz notifications@github.com
Date: Wed, 12 Dec 2012 03:07:31
To: webpy/webpywebpy@noreply.github.com
Reply-To: webpy/webpy reply@reply.github.com
Subject: Re: [webpy] IPv6 support (#70)

Can you submit it as a pull request?

Reply to this email directly or view it on GitHub:
#70 (comment)


aaronsw commented Dec 12, 2012

The pull request looks good, but can someone add a doctest for IPv6 to the validipaddr function?


mnakama commented Dec 13, 2012

Thanks for doing the commit for the IPv6 patch.

I didn't change the validipaddr function; it still does IPv4 only, as the docstring states. Did you mean you wanted IPv6 doctests for validip and validaddr? I just made a commit and pull request for it (my first attempt at github).

Commit: 411908a

Pull request: #196

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