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

feat: Add ability to use secure WebSocket to listen Logcat messages #2182

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

valfirst
Copy link
Collaborator

Change list

Closes #2181.

Types of changes

What types of changes are you proposing/introducing to Java client?
Put an x in the boxes that apply

  • No changes in production code.
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Details

}
String scheme = useSecureConnection ? "wss" : "ws";
SessionId sessionId = ((RemoteWebDriver) this).getSessionId();
URI endpointUri = URI.create(String.format("%s://%s:%s/ws/session/%s/appium/device/logcat", scheme, host,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cannot we detect this automatically be checking the server url? I assume if the server uses https then the web socket might only be secure as well

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I think, we can determine the scheme if server URL is available, but what will be a reliable way to get it? I can invent something like:

URL serverUrl = ((HttpCommandExecutor)((RemoteWebDriver) this).getCommandExecutor()).getAddressOfRemoteServer()

Also having this URL, is it needed to keep methods like:

startLogcatBroadcast(String host)
startLogcatBroadcast(String host, int port)

?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, the PR got lost in the stream. @valfirst feel free to ping me in slack if you need a review

we just check if the URLs protocol is https. that is enough. No other changes or overloads would be needed with that

@janmekota
Copy link

Probably here will be a similar issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

startLogcatBroadcast does not respect https
3 participants