Mohammad Zaki
06/13/2025, 1:09 PMsuspend inline fun <reified T : Any> PipelineContext<*, ApplicationCall>.getBodyContent(): T {
    return call.receive()
}Mohammad Zaki
06/13/2025, 1:32 PMYorgos S.
06/16/2025, 8:46 AMactor4kactor4kKanon
06/17/2025, 10:21 PMNicolas
06/18/2025, 12:16 PMfun Application.configureWebSocket(){
    install(WebSockets) {
        pingPeriod = 15.seconds
        timeout = 15.seconds
        maxFrameSize = kotlin.Long.MAX_VALUE
        masking = false
    }
}routing {
    webSocket("ws") {
        val token = call.request.queryParameters["token"]
        if (token == null) {
            close(CloseReason(CloseReason.Codes.VIOLATED_POLICY, "No Token"))
            return@webSocket
        }
        val decodedJWT = try { JwtFactory.buildverifier().verify(token) }
        catch (e: Exception) {
            close(CloseReason(CloseReason.Codes.VIOLATED_POLICY, "Invalid Token: ${e.message}"))
            return@webSocket
        }
        val userId: UUID = try { UUID.fromString(decodedJWT.getClaim(JwtClaimConstant.claimUserId).asString())  }
        catch (e: Exception) {
            close(CloseReason(CloseReason.Codes.VIOLATED_POLICY, "Invalid Token: ${e.message}"))
            return@webSocket
        }
        val sessionId = decodedJWT.id?.let {
            runCatching { UUID.fromString(it) }.getOrNull()
        } ?: run {
            close(CloseReason(CloseReason.Codes.VIOLATED_POLICY, "Invalid or missing sessionId (jti)"))
            return@webSocket
        }
        <http://logger.info|logger.info>("$userId is connected")
        try {
            println("$userId start")
            incoming.consumeEach {
                when (it) {
                    is Frame.Text -> {
                        val text = it.readText()
                        println("tototot $userId Received: $text")
                    }
                    is Frame.Close -> {
                        println("tototot $userId WebSocket closed by server with reason: ${it.readReason()}")
                    }
                    is Frame.Ping -> {
                        println("tototot $userId ping: $it")
                    }
                    is Frame.Pong -> {
                        println("tototot $userId pong: $it")
                    }  else -> {
                        println("tototot $userId else: $it")
                    }
                }
            }
        } catch (e: Exception) {
            println("$userId error $e")
         } finally {
            println("$userId finally remove")
        }
        println("$userId end")
    }
}dave
06/18/2025, 12:27 PMNicolas
06/23/2025, 9:27 AMAsadullah Nadeem
06/24/2025, 8:43 AMBharat Kumar
06/26/2025, 10:26 AMAlina Dolgikh [JB]
bk9735732777
07/03/2025, 6:36 AM# Stage 1: Cache Gradle dependencies
FROM gradle:latest AS cache
RUN mkdir -p /home/gradle/cache_home
ENV GRADLE_USER_HOME=/home/gradle/cache_home
COPY build.gradle.* gradle.properties /home/gradle/app/
COPY gradle /home/gradle/app/gradle
WORKDIR /home/gradle/app
RUN gradle clean build -i --stacktrace
# Stage 2: Build Application
FROM gradle:latest AS build
COPY --from=cache /home/gradle/cache_home /home/gradle/.gradle
COPY --chown=gradle:gradle . /home/gradle/src
WORKDIR /home/gradle/src
# Build the fat JAR, Gradle also supports shadow
# and boot JAR by default.
RUN gradle buildFatJar --no-daemon
# Stage 3: Create the Runtime Image
FROM amazoncorretto:22 AS runtime
EXPOSE 8080
RUN mkdir /app
COPY --from=build /home/gradle/src/build/libs/*.jar /app/ktor-docker-sample.jar
ENTRYPOINT ["java","-jar","/app/ktor-docker-sample.jar"]Ohiorenua Aigboje
07/08/2025, 12:47 PMOhiorenua Aigboje
07/14/2025, 6:39 AMJens Alfke
07/19/2025, 6:31 PMjoseph_ivie
07/23/2025, 2:54 PMJoel Denke
08/04/2025, 3:13 PMMattF
08/05/2025, 12:29 PMMohammad Zaki
08/05/2025, 6:45 PMval response = http.get("<http://127.0.0.1:8080/v1/flashcards?topic=Something&type=quiz&difficulty=hard>")
response.bodyAsText()Joel Denke
08/07/2025, 5:20 AMJonasBecker
08/14/2025, 10:03 AMAozen
09/08/2025, 12:02 PMالخبرات العلمية ScienceExperts
09/30/2025, 6:59 AMTom Molloy
10/03/2025, 6:27 AMRoger Roca (rogydev)
10/07/2025, 10:04 AMDequency Yates
10/07/2025, 6:10 PM최민규
10/09/2025, 10:53 AMMohammad Zaki
10/09/2025, 11:40 AMYorgos S.
10/16/2025, 5:31 PMPitam Poudel
10/18/2025, 4:30 AMAaron Freeman
10/28/2025, 5:07 AM