awslabs / amazon-kinesis-video-streams-webrtc-sdk-ios

iOS SDK for interfacing with the Amazon Kinesis Video Streams Signaling Service.
Apache License 2.0
66 stars 29 forks source link

Invalid HTTP upgrade, code: 403 #14

Closed KiranPatelSpaceo closed 4 years ago

KiranPatelSpaceo commented 4 years ago

Hello I am getting following error while SignalingClient trying to connect

What I am missing in setup server?

Connecting to web socket from channel config "Disconnected from signaling. WSError(type: Starscream.ErrorType.upgradeError, message: \"Invalid HTTP upgrade\", code: 403)"

Thanks

KiranPatelSpaceo commented 4 years ago

Fixed

fixed by using us-east-1 in place of USEast1 in awsRegionType

vico-aguado commented 3 years ago

@KiranPatelSpaceo Help!! Where do I make the change? Could you explain me more in detail? Please!!!

bartoslaw commented 3 years ago

@vico-aguado in my case it turned out iso8601 date used in KVSSigner function was wrong.

this is the method i changed it to

static func iso8601() -> (fullDateTimestamp: String, shortDate: String) {
        let dateFormatter: ISO8601DateFormatter = ISO8601DateFormatter()

        let date = Date()
        let dateString = dateFormatter.string(from: date).replacingOccurrences(of: ":", with: "").replacingOccurrences(of: "-", with: "")
        let index = dateString.index(dateString.startIndex, offsetBy: 8)
        let shortDate = dateString.substring(to: index)
        return (fullDateTimestamp: dateString, shortDate: shortDate)
    }

please note i'm using AWSStaticCredentials instead of Cognito