iosswiftparse-platformparse-ios-sdk

Parse live Query "Invalid HTTP upgrade", code: 403)


I have Connected my iOS Apps with self-hosted parse backend.I am implemented live query for real time data update on my iOS Apps. After subscription its showing me and error: WebSocket did disconnect with error: Optional(Starscream.WSError(type: Starscream.ErrorType.upgradeError, message: "Invalid HTTP upgrade", code: 403))

My connection in AppDelegate:

let parseConfig = ParseClientConfiguration {
            $0.applicationId = "myAppId"
            $0.clientKey = "fashionclip"
            $0.server = "https://parse.knowell.xyz/parse"
        }
        Parse.initialize(with: parseConfig)

In my ViewDidLoad:

        var armorQuery: PFQuery<Armor> {
            return (Armor.query()!
                .whereKeyExists("Name")
                .order(byAscending: "createdAt")) as! PFQuery<Armor>
        }
        client = ParseLiveQuery.Client(server: "https://parse.knowell.xyz/parse")
        subscription = client.subscribe(armorQuery)
            // handle creation events, we can also listen for update, leave, enter events
            .handle(Event.created) { _, armor in
                print("\(armor.Name)")
                self.sarverData = armor.Name
                self.myTableView.reloadData()
        }

Solution

  • Where are you hosting? This is a common problem with AWS and NGINX.

    You can configure your NGINX or similar.

    https://github.com/SoBump/ParseLiveQueryHelp/blob/master/guide.md