WebSockets

预计阅读时间: 1 分钟

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

本特性在构件 io.ktor:ktor-client-websockets:$ktor_version 中的 io.ktor.client.features.websocket.ws 方法中定义
dependencies { implementation "io.ktor:ktor-client-websockets:$ktor-version" }
dependencies { implementation("io.ktor:ktor-client-websockets:$ktor-version") }
<project> ... <dependencies> <dependency> <groupId>io.ktor</groupId> <artifactId>ktor-client-websockets</artifactId> <version>${ktor.version}</version> <scope>compile</scope> </dependency> </dependencies> </project>
dependencies { implementation "io.ktor:ktor-client-websockets-jvm:$ktor-version" }
dependencies { implementation("io.ktor:ktor-client-websockets-jvm:$ktor-version") }
<project> ... <dependencies> <dependency> <groupId>io.ktor</groupId> <artifactId>ktor-client-websockets-jvm</artifactId> <version>${ktor.version}</version> <scope>compile</scope> </dependency> </dependencies> </project>
dependencies { implementation "io.ktor:ktor-client-websockets-native:$ktor-version" }
dependencies { implementation("io.ktor:ktor-client-websockets-native:$ktor-version") }
<project> ... <dependencies> <dependency> <groupId>io.ktor</groupId> <artifactId>ktor-client-websockets-native</artifactId> <version>${ktor.version}</version> <scope>compile</scope> </dependency> </dependencies> </project>
dependencies { implementation "io.ktor:ktor-client-websockets-js:$ktor-version" }
dependencies { implementation("io.ktor:ktor-client-websockets-js:$ktor-version") }
<project> ... <dependencies> <dependency> <groupId>io.ktor</groupId> <artifactId>ktor-client-websockets-js</artifactId> <version>${ktor.version}</version> <scope>compile</scope> </dependency> </dependencies> </project>