Skip to content
This repository has been archived by the owner on Dec 31, 2023. It is now read-only.

Updated Python example code to use 127.0.0.1 instead of localhost #391

Merged
merged 1 commit into from
Jun 16, 2023

Conversation

Aquafina-water-bottle
Copy link
Contributor

@Aquafina-water-bottle Aquafina-water-bottle commented Jun 15, 2023

Apparently, urllib.request.urlopen takes a very long time to load when using localhost instead of 127.0.0.1 on Windows. This PR simply changes localhost to 127.0.0.1 in the sample code.

I initially thought of doing something like:

import platform
url = "127.0.0.1" if platform.system() == "Windows" else "localhost"

However, given that the Javascript example is using 127.0.0.1 already, I figured it is fine to replace localhost entirely.

Related issue & more reading material: #389

@FooSoft
Copy link
Owner

FooSoft commented Jun 16, 2023

How bizarre! Anyways, thanks for the fix!

@FooSoft FooSoft merged commit eef3be8 into FooSoft:master Jun 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants