Aleksandar Ilic
07/29/2023, 11:55 AMfun main(args: Array<String>) {
runBlocking {
val selectorManager = SelectorManager(<http://Dispatchers.IO|Dispatchers.IO>)
val serverSocket = aSocket(selectorManager).tcp().bind("127.0.0.1", 9002)
println("Server is listening at ${serverSocket.localAddress}")
while (true) {
val socket = serverSocket.accept()
println("Accepted $socket")
launch {
val receiveChannel = socket.openReadChannel()
val sendChannel = socket.openWriteChannel(autoFlush = true)
sendChannel.writeStringUtf8("Please enter your name\n")
try {
while (true) {
val name = receiveChannel.readUTF8Line()
sendChannel.writeStringUtf8("Hello, $name!\n")
}
} catch (e: Throwable) {
socket.close()
}
}
}
}
}
But when I try to connect it to it from Postman on <wss://127.0.0.1:9002>
I’m getting
Error: write EPROTO 140509838351224:error:100000f7:SSL routines:OPENSSL_internal:WRONG_VERSION_NUMBER:../../../../src/third_party/boringssl/src/ssl/tls_record.cc:242:
Any help really appreciated. Thanks!Aleksei Tirman [JB]
07/29/2023, 12:03 PMAleksandar Ilic
07/29/2023, 12:10 PM0.0.0.0:8080
and I’m connecting to wss:\\0.0.0.0:8080\echo
with Postman when I get the error.
Maybe my computer is missing some libs.Aleksandar Ilic
07/29/2023, 12:22 PMws:\\0.0.0.0:8080\echo
instead since there is no SSL configured. Thanks @Aleksei Tirman [JB] again for pointing in right direction.