Skip to content

Need help upgrading Websocket #99

Closed Answered by nickottocode
UgoEkwe asked this question in General help
Discussion options

You must be logged in to vote

Hi @UgoEkwe!
I am pretty unfamiliar with Swift, but I do want to check on a couple of things:

I'm getting an HTTP/1.1 400 Bad request file sent back from the Websocket instead of JSON

I take this to mean the connection never makes the upgrade to websockets? Two things to check are:

  • In your authorization header code I see options.setAdditionalHeaders([("Authorization", apiKey)]) Perhaps Swift does something I don't know about, but we do require the header to be "Authorization: Token $apiKey" (the word "Token" must appear as well).
  • The url path looks good, but I don't see where the full URL with the path is passed in? In the connection code there is host: NWEndpoint.Host(url.host!), but …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@UgoEkwe
Comment options

Answer selected by UgoEkwe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants