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

Charles Proxy is not tracking wss: traffic #756

Closed
KonstantinEfimenko opened this issue Apr 1, 2020 · 6 comments
Closed

Charles Proxy is not tracking wss: traffic #756

KonstantinEfimenko opened this issue Apr 1, 2020 · 6 comments

Comments

@KonstantinEfimenko
Copy link

With current solution b074c6c

Charles Proxy is not tracking wss: traffic, but works fine if we use next solution:

if enableSOCKSProxy {
let socksConfig = CFDictionaryCreateMutableCopy(nil, 0, CFNetworkCopySystemProxySettings()!.takeRetainedValue())
let propertyKey = CFStreamPropertyKey(rawValue: kCFStreamPropertySOCKSProxy)
let dict = socksConfig as? [String: Any]
if let ip = dict?["HTTPSProxy"] as? String, let port = dict?["HTTPSPort"] as? Int {
let customSocksConfig = ["SOCKSProxy": ip, "SOCKSPort": port + 1, "SOCKSEnable": 1] as CFDictionary?
CFWriteStreamSetProperty(outputStream, propertyKey, customSocksConfig)
CFReadStreamSetProperty(inputStream, propertyKey, customSocksConfig)
}
}

in Charles Proxy setting Socks Proxy is enabled on port 8889 and HTTP Proxy on port 8888

Could it be taken in to build?

@michalcichon
Copy link

michalcichon commented Apr 4, 2020

Hey @KonstantinEfimenko. Charles works totally fine with wss and Starscream. Maybe try to check your SSL settings? You need to add your host address to SSL settings and install Charles certificate on your device/simulator to be able to read the traffic.

Image 2020-04-04 at 9 19 26 PM

Image 2020-04-04 at 9 21 04 PM

More info here.

@michalcichon
Copy link

The change you abovementioned was merged to master but at some point removed. I don't think it's needed anymore.

@daltoniam
Copy link
Owner

@michalcichon thanks!

@KonstantinEfimenko
Copy link
Author

Yes, it is really strange. I use Starscream with https://github.com/apollographql/apollo-ios and can track only HTTP. On mobile device wss intercepts fine if I set it as mentioned in code.Emulator doesn't intercept at all. In device I set https://chls.pro/192.168.88.XXX:8889.socks.pac in automatic poxy mode. Also set it up in charlesproxy.

@sirnacnud
Copy link

For version 3.1.1, you do need the change @KonstantinEfimenko suggested to match the default socks proxy settings used by Charles.

@michalcichon
Copy link

Here is the issue: apollographql/apollo-ios#1030 They should update their dependencies in apollo project.

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

No branches or pull requests

4 participants