-
Notifications
You must be signed in to change notification settings - Fork 162
SERVER_NAME differs from wsgiref #162
Comments
Hi, not obvious to me, any pull request welcome ;-) |
I've added an endpoint to the |
Thanks! I'm looking into it. |
Could you please have a look at https://github.com/msornay/pulsar/commit/633b8622cf48b9d1b676977d8d949afaf01a656e and give me advices ? It provides what I think is the correct behavior, i.e. the result of However :
Thanks ! |
Looks good to me, can you pull request? I'll code review there and check test passage. Many thanks |
SERVER_NAME using getfqdn() on getsockname() #162
merged with master, thanks! |
@msornay your test fails on mac OS X. |
I have unfortunately no way of testing that myself. Could you give me the output ? Thanks. |
On my mac when I do: >>> server = socket.getfqdn('::1')
>>> info = socket.getaddrinfo(server, None)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File ".pyenv/versions/3.4.3/lib/python3.4/socket.py", line 533, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 8] nodename nor servname provided, or not known On a linux box this works fine, therefore it is not a big deal, but it would be nice to have the test working on mac too. |
(when using an
/etc/hosts
entry)Hello,
Consider the following code :
If this runs on a remote server, for which I have an entry "server" in my /etc/hosts and I use :
wget -qO- http://server:8000
It returns the remote server hostname ( as returned by gethostname() )
When using Pulsar's WSGIServer (with --bind 0.0.0.0:8000) it returns 'server', probably because socket.getfqdn('server') fails in server.py and return its argument (and it takes a lot of time to do so because it triggers a DNS lookup, which is problematic in my setup).
I have not taken the time to dive further in the server.py code yet to make a pull request, but I will unless the fix is obvious to you.
Thanks !
The text was updated successfully, but these errors were encountered: