ProxymanApp / atlantis

Capture HTTP/HTTPS, and Websocket from iOS app without proxy.
https://proxyman.io
Apache License 2.0
1.27k stars 95 forks source link

Should find a previous WS Package! #84

Open khoogheem opened 3 years ago

khoogheem commented 3 years ago

Proxyman version? 2.32.1 (23210)

macOS Version? 11.4

Steps to reproduce

when proxyman is not running... I get these issue:

Fatal error: Something went wrong! Should find a previous WS Package! Please contact the author!: file Atlantis/Atlantis.swift, line 358

kjoe07 commented 2 years ago

got this same crash any news on it

NghiaTranUIT commented 2 years ago

@kjoe07 Just wondering: Which Atlantis version and your iOS version are you using? I could not reproduce this issue in the last time and I'd like to investigate it again 👍

kjoe07 commented 2 years ago

iOS 15.3 Xcode 13.2.1 macOS Monterrey proxyMan latest version, Install with swift package manager using urlSession for sockets, chafed to 1.14.0 and 1.9.0 and got the same error every time also have amplify as dependency and guess is using starscream

NghiaTranUIT commented 2 years ago

@kjoe07 if you're using Starscream to perform the Websocket, do you use NativeEngine by setting useCustomEngine: false?

for example:

let ws = Websocket(request: myRequest, useCustomEngine: false)

Ref: https://github.com/daltoniam/Starscream/blob/c68359159dcf0b5de9b536b9a959e9e435e968d3/Sources/Starscream/WebSocket.swift#L118


It's because, by default, Starscream would use TCPTransport rather than URLSessionWebsocketTask behind the hood. On the other hand, Atlantis only supports URLSessionWebsocketTask.

kjoe07 commented 2 years ago

I now I don't use start scream it's a dependency for amplify not for my app my sockets connections are handle with url session

VaslD commented 1 year ago

@NghiaTranUIT I've also encountered this. Does Atlantis support initialization elsewhere other than AppDelegate?

I wrapped Atlantis in a toggle switch in app settings. If a WS connection was mid-flight and I then enabled Atlantis (setup with no specific host), this crash would very likely be triggered.

NghiaTranUIT commented 1 year ago

Technically, you can initialize the Atlantis framework anywhere in the app, not just AppDelegate.

When the app is crashed, can you take a screenshot where the crash occurs?

vani2 commented 1 year ago
Screenshot 2023-04-21 at 15 23 20

It happens when I manually try to cancel URLSessionWebSocketTask with .normalClosure.

NghiaTranUIT commented 1 year ago

@vani2 Thanks. I will look on it today 👍

NghiaTranUIT commented 1 year ago

@vani2 let's update to Atlantis 1.21.1, it should fix the crash 👍