PusherSwift Can't establish a websocket connection

I'm trying to connect to a socket from my own application, when I call pusher.connect() the following is displayed in the console:

2024-01-23 13:05:30.963189+0500 pusher_test[64299:2525981] [] nw_protocol_copy_ws_definition_block_invoke [C1:1] nw_ws_validate_server_response
2024-01-23 13:05:30.964076+0500 pusher_test[64299:2525981] [connection] nw_read_request_report [C1] Receive failed with error "Software caused connection abort"

Below is my code for testing

class AuthRequestBuilder: AuthRequestBuilderProtocol {
            func requestFor(socketID: String, channelName: String) -> URLRequest? {
                var request = URLRequest(url: URL(string: authPath)!)
                request.httpMethod = "POST"
                request.addValue("Bearer "+token, forHTTPHeaderField: "Authorization")
                request.addValue("application/json", forHTTPHeaderField: "Content-Type")
                request.addValue("application/json", forHTTPHeaderField: "Accept")
                return request

            }
        }

        let optionsWithEndpoint = PusherClientOptions(
            authMethod: AuthMethod.authRequestBuilder(authRequestBuilder: AuthRequestBuilder()),
            host:.host(host),
            port:6001,
            useTLS: false
        )
        pusher = Pusher(key: "pusher_app_key", options: optionsWithEndpoint)
        
        pusher.connect()
        
        let myPresenceChannel = pusher.subscribeToPresenceChannel(channelName: "presence-online")

I write in flutter and am new to swift, but the error occurs in native, that's why I'm here. xcode version: 14.3.1. Swift version: swift-driver version: 1.75.2 Apple Swift version 5.8.1 (swiftlang-5.8.0.124.5 clang-1403.0.22.11.100) I tested it on the iOS simulator, but the error persists on a real device

I can’t help you with third-party libraries. My advice is that you dig through those libraries to find out which, if any, APIs are failing.

Speaking of that, what’s actually failing here? Does your WebSocket fail with an error? If so, what’s the error?

Or does everything work but you’re worried about those log messages?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

PusherSwift Can't establish a websocket connection
 
 
Q