# The websocket connection to the server failed to establish iOS

**URL:** <https://community.sendbird.com/t/the-websocket-connection-to-the-server-failed-to-establish-ios/10185>\
**Category:** iOS\
**Tags:** feedback, ios, uikit, bug, question\
**Created:** [October 14, 2024, 3:27pm UTC](https://community.sendbird.com/t/the-websocket-connection-to-the-server-failed-to-establish-ios/10185 "2024-10-14T15:27:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pallavi\_Aggarwal](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/pallavi_aggarwal/32/3106_2.png) [@Pallavi\_Aggarwal](https://community.sendbird.com/u/Pallavi_Aggarwal)\
**Post date:** [October 14, 2024, 3:27pm UTC](https://community.sendbird.com/t/the-websocket-connection-to-the-server-failed-to-establish-ios/10185/1 "2024-10-14T15:27:38Z")

</div>

**[Problem/Question]**  
// Detailed description of issue.  
I am getting The websocket connection to the server failed to establish. everytime i try to connect to sendbird sdk iOS .

```auto
func connectToSendBird(onCompletion: @escaping (SendbirdChatSDK.User?, FoodAPIError?) -> Void) {
        guard let credentials = userSignUpInfo else {
            onCompletion(nil, nil)
            return
        }
        SendbirdChat.connect(userId: credentials.id, authToken: credentials.token, completionHandler: { user, error in
            guard error == nil else {
                self.analyticsManager.log(.errorOnDriverChat(
                    errorCode: String(error?.code ?? 0),
                    message: error?.localizedDescription ?? "",
                    context: "sendbird_connect",
                    userId: self.userId
                ))

                onCompletion(nil, self.asFoodAPIError(error: error))
                return
            }
            onCompletion(user, nil)
        })
    }

```

// What version of the SDK are you using?  
4.5.0

**[Reproduction Steps]**  
every time i connect to send bird sdk

**[Frequency]**  
// How frequently is this issue occurring?  
every time

**[Current impact]**  
// How is this currently impacting your implementation?  
Not able send and recieve driver chat.
