WebSockets

预计阅读时间:1分钟

此功能启用与服务器的双向WebSocket连接. 您可以在其专用的WebSockets页面中阅读有关它的更多信息.

此功能在方法中定义io.ktor.client.features.websocket.ws在神器io.ktor:ktor-client-websockets:$ktor_version .
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>

by  ICOPY.SITE