WebSockets

This feature enables bi-directional WebSocket connections with the server.You can read more about it in its dedicated WebSockets page.

This feature is defined in the method io.ktor.client.features.websocket.ws in the artifact io.ktor:ktor-client-websockets:$ktor_version.

  1. dependencies {
  2. implementation "io.ktor:ktor-client-websockets:$ktor_version"
  3. }
  1. dependencies {
  2. implementation("io.ktor:ktor-client-websockets:$ktor_version")
  3. }
  1. <project>
  2. ...
  3. <dependencies>
  4. <dependency>
  5. <groupId>io.ktor</groupId>
  6. <artifactId>ktor-client-websockets</artifactId>
  7. <version>${ktor.version}</version>
  8. <scope>compile</scope>
  9. </dependency>
  10. </dependencies>
  11. </project>
  1. dependencies {
  2. implementation "io.ktor:ktor-client-websockets-jvm:$ktor_version"
  3. }
  1. dependencies {
  2. implementation("io.ktor:ktor-client-websockets-jvm:$ktor_version")
  3. }
  1. <project>
  2. ...
  3. <dependencies>
  4. <dependency>
  5. <groupId>io.ktor</groupId>
  6. <artifactId>ktor-client-websockets-jvm</artifactId>
  7. <version>${ktor.version}</version>
  8. <scope>compile</scope>
  9. </dependency>
  10. </dependencies>
  11. </project>
  1. dependencies {
  2. implementation "io.ktor:ktor-client-websockets-native:$ktor_version"
  3. }
  1. dependencies {
  2. implementation("io.ktor:ktor-client-websockets-native:$ktor_version")
  3. }
  1. <project>
  2. ...
  3. <dependencies>
  4. <dependency>
  5. <groupId>io.ktor</groupId>
  6. <artifactId>ktor-client-websockets-native</artifactId>
  7. <version>${ktor.version}</version>
  8. <scope>compile</scope>
  9. </dependency>
  10. </dependencies>
  11. </project>
  1. dependencies {
  2. implementation "io.ktor:ktor-client-websockets-js:$ktor_version"
  3. }
  1. dependencies {
  2. implementation("io.ktor:ktor-client-websockets-js:$ktor_version")
  3. }
  1. <project>
  2. ...
  3. <dependencies>
  4. <dependency>
  5. <groupId>io.ktor</groupId>
  6. <artifactId>ktor-client-websockets-js</artifactId>
  7. <version>${ktor.version}</version>
  8. <scope>compile</scope>
  9. </dependency>
  10. </dependencies>
  11. </project>