Begum Turan
01/16/2023, 8:18 PMEmil Kantis
01/16/2023, 8:57 PMBegum Turan
01/16/2023, 9:14 PMhfhbd
01/16/2023, 9:17 PMadryan_ip
01/16/2023, 9:35 PMBegum Turan
01/16/2023, 9:54 PMhfhbd
01/16/2023, 9:57 PMsend
everytime:
webSocket("/time") {
flow {
while(true) { delay(1.seconds); emit(Unit) }
}.collect {
send("Hello")
}
}
Begum Turan
01/16/2023, 10:01 PMhfhbd
01/16/2023, 10:03 PMBegum Turan
01/16/2023, 10:05 PMhfhbd
01/16/2023, 10:08 PMlocalhost/time
? The latter is a simple HTTP get request. If you want to get a new value every second in your browser too, you need to use a websocket connection too (ignoring HTTP/2).Begum Turan
01/16/2023, 10:15 PMhfhbd
01/16/2023, 10:17 PMBegum Turan
01/16/2023, 10:17 PMhfhbd
01/16/2023, 10:19 PMBegum Turan
01/16/2023, 10:20 PMhfhbd
01/16/2023, 10:30 PM/time
sending some text every second. Now the clients: postman is a tool supporting a websocket connection after configurating it.
So now you need to create a javascript application to configure the request from your browser to the server to use websockets too.
At the moment you just send a HTTP get request to your server, which is stateless and does not update by itself. Instead you need to create a js app returned by your server (or some other host), to start the websocket connection.
Take a look at https://kotlinlang.org/docs/js-overview.html if you want to implement your web app in Kotlin too.Begum Turan
01/16/2023, 10:48 PMAleksei Tirman [JB]
01/17/2023, 9:11 AMBegum Turan
01/17/2023, 3:02 PMAleksei Tirman [JB]
01/17/2023, 3:44 PM