IPv6 support #70

Open
indeyets opened this Issue Jun 11, 2011 · 8 comments

Comments

Projects
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

Contributor

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:127.0.0.1 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...

Contributor

zamabe commented Dec 12, 2012

Should specify socket.error in exception catching.

Contributor

mnakama commented Dec 12, 2012

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

http://pastebin.com/Gq7G9wM7

Contributor

aaronsw commented Dec 12, 2012

Can you submit it as a pull request?

zamabe referenced this issue Dec 12, 2012

Merged

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)

Contributor

aaronsw commented Dec 12, 2012

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

Contributor

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