-
Notifications
You must be signed in to change notification settings - Fork 33
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: Add method to get and display IP address on vebose #48
base: master
Are you sure you want to change the base?
Conversation
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.
@t0xic0der I can use another way to fetch the IP Address. I didn't understand why the above won't be helpful. Are you saying we want to display both IPv4 and IPv6 on verbose? |
No no. I mean that in both the cases (for IPv4 and IPv6) - the address which is obtained by the |
@t0xic0der Ahh got it ! I am looking at this right now. |
@vinmay You better finish doing this before @shivangswain does 🤣 |
@t0xic0der Hey I checked in a solution for the ipV4, could you just check if that is what you are looking for ? |
Hi @vinmay, please rebase the branch of your fork to keep up with the latest changes made to |
@t0xic0der Done. Another question I had while working on this was, is the intention here to display the public IP address that the system is connected to ? |
I don't quite follow. The purpose is to simply display the IP address of the system where the service is hosted from, so that folks joining the service would get to know which address to connect to. |
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.
Take a look at the suggested changes.
def getipaddr(): | ||
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) | ||
s.connect(("8.8.8.8", 80)) | ||
return s.getsockname()[0] |
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.
The IP address provided here would be restricted to only IPv4 addresses.
Take a look at this.
Even when IPv6 is selected, only the IPv4 address is displayed.
Also, the displayed IP address is not very useful when communicating across dissimilar networks as the address is applicable only in the intranet.
Any updates, @vinmay? |
@t0xic0der I haven't gone back to this yet. If someone else has a better solution in between, please feel free to accept theirs. I will be getting back on this from Monday for sure. |
Sure thing. @shivangswain is working on it. Take your time. 😄 |
@t0xic0der Should I just close this? |
This was exactly the intention of the issue. Currently your implementation displays the IP assigned to the device running the host by the local router or switch and not the public IP address of the server. You can out check my implementation if you want to know how I did it. |
#23