question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add WebSocket support for the iOS

See original GitHub issue

Ktor Version and Engine Used (client or server and name) Using io.ktor:ktor-client-ios:1.3.2

Describe the bug This code prints kotlin.IllegalStateException: [generateNonce] is not supported on iOS:

  GlobalScope.launch {
    try {
      HttpClient {
        install(WebSockets)
      }.wss(
        host = "websocketstest.com",
        path = "/service"
      ) {
        send(Frame.Text("timer"))
        for (frame in incoming)
          println((frame as Frame.Text).readText())
      }
    } catch (e: Exception) {
      println(e)
    }
  }

Looks like someone tried to fix this here: https://github.com/ktorio/ktor/pull/1535

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:11
  • Comments:19 (4 by maintainers)

github_iconTop GitHub Comments

20reactions
AlexanderKudinovcommented, Jun 27, 2021

Hi! Any news? Websocket support for iOS (namely for KMM) is really very necessary. Looking forward!

5reactions
e5lcommented, May 26, 2020

Hi @Hixie, the WebSocket is unsupported on the iOS for now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

WebSocket Options | Apple Developer Documentation
Adds to the list of supported application protocols that will be presented to a WebSocket ... Adds an additional HTTP header to a...
Read more >
How to create a native iOS WebSocket client and connect it to ...
Post explaining creating web socket client and server in Swift on iOS and how to connect with demo video and examples. Web sockets...
Read more >
Websockets in iOS 13 Using Swift and Xcode 11
Apple has finally added Websockets as first-class citizen to its platforms ... Websockets in iOS 13, macOS 10.15, tvOS 13, watchOS 6, and...
Read more >
WebSockets and iOS: Client-side engineering challenges
Learn about the many challenges of implementing a dependable client-side WebSocket solution to provide iOS users with better and faster ...
Read more >
WebSockets on iOS – Real-time Communication That Doesn't ...
Downloading the Starscream WebSocket library ... Configuration of WebSockets on iOS is not simple, because there is no built-in API interface that ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found