Skip to content
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

p2p: Fix public IP hack for browser environments #359

Merged
merged 1 commit into from Aug 15, 2019

Conversation

@albrow
Copy link
Member

albrow commented Aug 14, 2019

https://ifconfig.me responds with different results depending on the value of the User-Agent header. For browser environments, it responds with HTML and for non-browser environments it responds with your IP address in plain text. Adding /ip to the URL results in the same behavior regardless of user agent.

@albrow albrow requested a review from fabioberger Aug 14, 2019
@albrow albrow added the browser label Aug 14, 2019
@albrow albrow added this to the Browser Support milestone Aug 14, 2019
@albrow albrow changed the title Fix public IP hack for browser environments p2p: Fix public IP hack for browser environments Aug 15, 2019
@fabioberger

This comment has been minimized.

Copy link
Contributor

fabioberger commented Aug 15, 2019

@albrow does this return a sensible, usable response? If not, why not just skip this step if in the browser?

@albrow

This comment has been minimized.

Copy link
Member Author

albrow commented Aug 15, 2019

does this return a sensible, usable response? If not, why not just skip this step if in the browser?

Good point; probably not. It might be useful for WebRTC connections but I think the ICE process is already designed to do this.

Nonetheless we should still use the url with the /ip suffix. It's more reliable and doesn't depend on your User-Agent (which could still change slightly for different platforms even for non-browser peers).

@albrow albrow merged commit 1b8bd9b into development Aug 15, 2019
1 check passed
1 check passed
ci/circleci: build Your tests passed on CircleCI!
Details
@albrow albrow deleted the fix/ip-hack-for-browsers branch Aug 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.