-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue 23: Display public IP address #85
Conversation
Added a method to get and display public IP address in the server verbose
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please take a look at the changes I have suggested.
@@ -2,6 +2,7 @@ | |||
from prompt_toolkit import print_formatted_text, HTML | |||
from websockets.exceptions import ConnectionClosedError | |||
from utils.helper_display import HelperDisplay | |||
from requests import get |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
requests
is quite a heavy module to import for task as small as this. Also, we cannot just assume that the users have curl
or wget
binaries installed on their distribution which makes it a difficult point to discuss about.
def ipaddress(): | ||
return get('https://api64.ipify.org').text |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
servenow(netpdata, chatport) | ||
except OSError: | ||
print_formatted_text(HTML("[" + obtntime() + "] " + "<b>SNCTRYZERO</b> > <red><b>The server could not be started up</b></red>")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice touch with the corrected message. 😉
Any updates, @shivangswain? |
Yeah, changing the whole implementation to use urllib3. ETA: 30 mins. |
Added a method to fetch and display public IP address in the server verbose
Linked Issue: #23