Skip to content

always listens on 0.0.0.0 unless host is exactly 127.0.0.1 #52

@raylu

Description

@raylu
import sys, fastwsgi

def app(environ, start_response):
    start_response('200 OK', [])
    return [b'hi']

fastwsgi.run(app, sys.argv[1], 8000)

running this with either 127.1 or localhost both cause it to claim

FastWSGI server listening at http://127.1:8000

or

FastWSGI server listening at http://localhost:8008

but

$ netstat -tnlp | rg 8000
tcp        0      0 0.0.0.0:8000            0.0.0.0:*               LISTEN      21863/python3

I suspect it's failing to parse variants of the host that don't exactly match the address of an interface, but it should at least error instead of going ahead with 0.0.0.0

I tried to build the source to see what's up but the Makefile is pretty wonky (it's trying to build with -o instead of -c even though there's no main) so I gave up

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions