https://kotlinlang.org logo
Join the conversationJoin Slack
Channels
100daysofcode
100daysofkotlin
100daysofkotlin-2021
advent-of-code
aem
ai
alexa
algeria
algolialibraries
amsterdam
android
android-architecture
android-databinding
android-studio
androidgithubprojects
androidthings
androidx
androidx-xprocessing
anime
anko
announcements
apollo-kotlin
appintro
arabic
argentina
arkenv
arksemdevteam
armenia
arrow
arrow-contributors
arrow-meta
ass
atlanta
atm17
atrium
austin
australia
austria
awesome-kotlin
ballast
bangladesh
barcelona
bayarea
bazel
beepiz-libraries
belgium
berlin
big-data
books
boston
brazil
brikk
budapest
build
build-tools
bulgaria
bydgoszcz
cambodia
canada
carrat
carrat-dev
carrat-feed
chicago
chile
china
chucker
cincinnati-user-group
cli
clikt
cloudfoundry
cn
cobalt
code-coverage
codeforces
codemash-precompiler
codereview
codingame
codingconventions
coimbatore
collaborations
colombia
colorado
communities
competitive-programming
competitivecoding
compiler
compose
compose-android
compose-desktop
compose-hiring
compose-ios
compose-mp
compose-ui-showcase
compose-wear
compose-web
connect-audit-events
corda
cork
coroutines
couchbase
coursera
croatia
cryptography
cscenter-course-2016
cucumber-bdd
cyprus
czech
dagger
data2viz
databinding
datascience
dckotlin
debugging
decompose
decouple
denmark
deprecated
detekt
detekt-hint
dev-core
dfw
docs-revamped
dokka
domain-driven-design
doodle
dsl
dublin
dutch
eap
eclipse
ecuador
edinburgh
education
effective-kotlin
effectivekotlin
emacs
embedded-kotlin
estatik
event21-community-content
events
exposed
failgood
fb-internal-demo
feed
firebase
flow
fluid-libraries
forkhandles
forum
fosdem
fp-in-kotlin
framework-elide
freenode
french
fritz2
fuchsia
functional
funktionale
gamedev
ge-kotlin
general-advice
georgia
geospatial
german-lang
getting-started
github-workflows-kt
glance
godot-kotlin
google-io
gradle
graphic
graphkool
graphql
graphql-kotlin
graviton-browser
greece
grpc
gsoc
gui
hackathons
hacktoberfest
hamburg
hamkrest
helios
helsinki
hexagon
hibernate
hikari-cp
hire-me
hiring
hongkong
hoplite
http4k
hungary
hyderabad
image-processing
india
indonesia
inkremental
intellij
intellij-plugins
intellij-tricks
internships
introduce-yourself
io
ios
iran
israel
istanbulcoders
italian
jackson-kotlin
jadx
japanese
jasync-sql
java-to-kotlin-refactoring
javadevelopers
javafx
javalin
javascript
jdbi
jhipster-kotlin
jobsworldwide
jpa
jshdq
juul-libraries
jvm-ir-backend-feedback
jxadapter
k2-early-adopters
kaal
kafka
kakao
kalasim
kapt
karachi
karg
karlsruhe
kash_shell
kaskade
kbuild
kdbc
kgen-doc-tools
kgraphql
kinta
klaxon
klock
kloudformation
kmdc
kmm-español
kmongo
knbt
knote
koalaql
koans
kobalt
kobweb
kodein
kodex
kohesive
koin
koin-dev
komapper
kondor-json
kong
kontent
kontributors
korau
korean
korge
korim
korio
korlibs
korte
kotest
kotest-contributors
kotless
kotlick
kotlin-asia
kotlin-beam
kotlin-by-example
kotlin-csv
kotlin-data-storage
kotlin-foundation
kotlin-fuel
kotlin-in-action
kotlin-inject
kotlin-latam
kotlin-logging
kotlin-multiplatform-contest
kotlin-mumbai
kotlin-native
kotlin-pakistan
kotlin-plugin
kotlin-pune
kotlin-roadmap
kotlin-samples
kotlin-sap
kotlin-serbia
kotlin-spark
kotlin-szeged
kotlin-website
kotlinacademy
kotlinbot
kotlinconf
kotlindl
kotlinforbeginners
kotlingforbeginners
kotlinlondon
kotlinmad
kotlinprogrammers
kotlinsu
kotlintest
kotlintest-devs
kotlintlv
kotlinultimatechallenge
kotlinx-datetime
kotlinx-files
kotlinx-html
kotrix
kotson
kovenant
kprompt
kraph
krawler
kroto-plus
ksp
ktcc
ktfmt
ktlint
ktor
ktp
kubed
kug-leads
kug-torino
kvision
kweb
lambdaworld_cadiz
lanark
language-evolution
language-proposals
latvia
leakcanary
leedskotlinusergroup
lets-have-fun
libgdx
libkgd
library-development
linkeddata
lithuania
london
losangeles
lottie
love
lychee
macedonia
machinelearningbawas
madrid
malaysia
mathematics
meetkotlin
memes
meta
metro-detroit
mexico
miami
micronaut
minnesota
minutest
mirror
mockk
moko
moldova
monsterpuzzle
montreal
moonbean
morocco
motionlayout
mpapt
mu
multiplatform
mumbai
munich
mvikotlin
mvrx
myndocs-oauth2-server
naming
navigation-architecture-component
nepal
new-mexico
new-zealand
newname
nigeria
nodejs
norway
npm-publish
nyc
oceania
ohio-kotlin-users
oldenburg
oolong
opensource
orbit-mvi
osgi
otpisani
package-search
pakistan
panamá
pattern-matching
pbandk
pdx
peru
philippines
phoenix
pinoy
pocketgitclient
polish
popkorn
portugal
practical-functional-programming
proguard
prozis-android-backup
pyhsikal
python
python-contributors
quasar
random
re
react
reaktive
realm
realworldkotlin
reductor
reduks
redux
redux-kotlin
refactoring-to-kotlin
reflect
refreshversions
reports
result
rethink
revolver
rhein-main
rocksdb
romania
room
rpi-pico
rsocket
russian
russian_feed
russian-kotlinasfirst
rx
rxjava
san-diego
science
scotland
scrcast
scrimage
script
scripting
seattle
serialization
server
sg-user-group
singapore
skia-wasm-interop-temp
skrape-it
slovak
snake
sofl-user-group
southafrica
spacemacs
spain
spanish
speaking
spek
spin
splitties
spotify-mobius
spring
spring-security
squarelibraries
stackoverflow
stacks
stayhungrystayfoolish
stdlib
stlouis
strife-discord-lib
strikt
students
stuttgart
sudan
swagger-gradle-codegen
swarm
sweden
swing
swiss-user-group
switzerland
talking-kotlin
tallinn
tampa
teamcity
tegal
tempe
tensorflow
terminal
test
testing
testtestest
texas
tgbotapi
thailand
tornadofx
touchlab-tools
training
tricity-kotlin-user-group
trójmiasto
truth
tunisia
turkey
turkiye
twitter-feed
uae
udacityindia
uk
ukrainian
uniflow
unkonf
uruguay
utah
uuid
vancouver
vankotlin
vertx
videos
vienna
vietnam
vim
vkug
vuejs
web-mpp
webassembly
webrtc
wimix_sentry
wwdc
zircon
Powered by Linen
ktor
  • r

    rocketraman

    06/27/2018, 4:15 PM
    I'm doing
    call.response.contentType(ContentType.Application.Json.withCharset(Charsets.UTF_8))
    as per https://ktor.io/servers/responses.html#properties, but get the Exception
    io.ktor.response.UnsafeHeaderException: Header Content-Type is controlled by the engine and cannot be set explicitly
    . How can I send JSON? I don't have
    ContentNegotiation
    installed, and don't want it.
    📝 1
    c
    d
    • 3
    • 9
  • j

    jlleitschuh

    06/27/2018, 6:40 PM
    Howdy devs. I want to hear what everyone's thoughts are on my proposal here: https://github.com/ktorio/ktor/issues/453
    👍 4
    d
    k
    • 3
    • 5
  • m

    Matt

    06/28/2018, 8:09 AM
    I'm using cookie session, but was also wanting to implement some sort of CSRF protection -- are there any recommended ways of doing that at present that work alongside Ktor's session support?
    d
    m
    • 3
    • 3
  • e

    e5l

    06/29/2018, 8:58 AM
    ^thread
    s
    • 2
    • 3
  • c

    coder82

    06/29/2018, 12:18 PM
    any idea?
    d
    e
    s
    • 4
    • 26
  • k

    katokay

    06/29/2018, 11:40 PM
    I was a little surprised, but I’m sure there’s a logical explanation for this. Parameter “name” is null inside the interceptor but not inside the route. Is there another way to do this kind of thing?
    fun main(args: Array<String>) {
        val server = embeddedServer(Netty, port = 9000) {
            intercept(ApplicationCallPipeline.Call) {
                val name = call.parameters["name"]
                proceed()
            }
    
            routing {
                get("/login/{name}") {
                    val name = call.parameters["name"]
                    call.respond("Hello $name")
                }
            }
        }
        server.start(wait = true)
    }
    📝 1
    ✅ 1
    • 1
    • 2
  • k

    katokay

    06/30/2018, 11:47 PM
    Is the Locations feature experimental in the sense that it could disappear tomorrow, or experimental in the same way coroutines are experimental and subject to changes until things settle?
    d
    • 2
    • 2
  • r

    rahulrav

    07/01/2018, 12:42 AM
    I am trying to use the
    HttpClient
    backed by the
    io.ktor.client.engine.cio.CIO
    engine on App Engine Standard.
  • r

    rahulrav

    07/01/2018, 12:43 AM
    This is the exception i get
    java.lang.NoClassDefFoundError: Could not initialize class io.ktor.network.tls.CIOCipherSuites
        at io.ktor.client.engine.cio.HttpsConfig.<init>(CIOEngineConfig.kt:26)
        at io.ktor.client.engine.cio.CIOEngineConfig.<init>(CIOEngineConfig.kt:9)
        at io.ktor.client.engine.cio.CIO.create(CIO.kt:14)
        at io.ktor.client.engine.HttpClientEngineKt$config$1.create(HttpClientEngine.kt:47)
        at io.ktor.client.engine.HttpClientEngineFactory$DefaultImpls.create$default(HttpClientEngine.kt:36)
        at io.ktor.client.HttpClient.<init>(HttpClient.kt:32)
        at io.ktor.client.HttpClient.<init>(HttpClient.kt:31)
    Any ideas on how I can fix this ?
    e
    • 2
    • 2
  • d

    dave08

    07/02/2018, 11:47 AM
    Just tried making a new Ktor project w/ the IDEA plugin and got this error:
    Error:Kotlin: [Internal Error] java.lang.IllegalStateException: The provided plugin org.jetbrains.kotlin.scripting.compiler.plugin.ScriptingCompilerConfigurationComponentRegistrar is not compatible with this version of compiler
    	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment.<init>(KotlinCoreEnvironment.kt:186)
    	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment.<init>(KotlinCoreEnvironment.kt:119)
    	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment$Companion.createForProduction(KotlinCoreEnvironment.kt:418)
    	at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.createCoreEnvironment(K2JVMCompiler.kt:265)
    	at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:154)
    	at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:63)
    	at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.java:107)
    	at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.java:51)
    	at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:96)
    	at org.jetbrains.kotlin.daemon.CompileServiceImpl$compile$$inlined$ifAlive$lambda$1.invoke(CompileServiceImpl.kt:399)
    	at org.jetbrains.kotlin.daemon.CompileServiceImpl$compile$$inlined$ifAlive$lambda$1.invoke(CompileServiceImpl.kt:98)
    	at org.jetbrains.kotlin.daemon.CompileServiceImpl$doCompile$$inlined$ifAlive$lambda$2.invoke(CompileServiceImpl.kt:920)
    	at org.jetbrains.kotlin.daemon.CompileServiceImpl$doCompile$$inlined$ifAlive$lambda$2.invoke(CompileServiceImpl.kt:98)
    	at org.jetbrains.kotlin.daemon.common.DummyProfiler.withMeasure(PerfUtils.kt:137)
    	at org.jetbrains.kotlin.daemon.CompileServiceImpl.checkedCompile(CompileServiceImpl.kt:950)
    	at org.jetbrains.kotlin.daemon.CompileServiceImpl.doCompile(CompileServiceImpl.kt:919)
    	at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:397)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:498)
    	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:357)
    	at sun.rmi.transport.Transport$1.run(Transport.java:200)
    	at sun.rmi.transport.Transport$1.run(Transport.java:197)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
    	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:573)
    	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:835)
    	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:688)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:687)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    	at java.lang.Thread.run(Thread.java:748)
    Caused by: java.lang.AbstractMethodError: org.jetbrains.kotlin.scripting.compiler.plugin.ScriptingCompilerConfigurationComponentRegistrar.registerProjectComponents(Lcom/intellij/mock/MockProject;Lorg/jetbrains/kotlin/config/CompilerConfiguration;)V
    	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment.<init>(KotlinCoreEnvironment.kt:184)
    	... 33 more
    ?
    d
    • 2
    • 37
  • d

    dave08

    07/03/2018, 4:14 PM
    Is there a best practice for enabling debug logging level in Ktor for debug environments?
    d
    • 2
    • 11
  • r

    rocketraman

    07/03/2018, 4:16 PM
    I am using the http cio client -- how can I send an input stream to the client as the body?
    d
    • 2
    • 24
  • e

    enleur

    07/03/2018, 8:56 PM
    I have not seen any examples of integratin opentracing/jaeger in ktor. Can you point me in the right direction?
    d
    f
    • 3
    • 5
  • i

    Ian

    07/05/2018, 2:25 AM
    Does anyone know why a .send() would block indefinitely on the outbound channel of a WebSocket connection? I’m not seeing anything to indicate that the websocket has closed.
    d
    e
    • 3
    • 23
  • s

    spand

    07/05/2018, 6:15 AM
    Are there any json samples for the client ?
    ✅ 1
    :yes: 1
    📝 1
    d
    • 2
    • 2
  • v

    vincent.brule

    07/05/2018, 11:29 AM
    Hello. Just a question to know if it’s possible. I implement google auth in my backend with ktor. When I succeed the authentication, the google auth redirect to my route and after the backend send an header session to the client. The question is : when I try to authenticate with my front app in Reactjs, I want to fetch the route, be redirect to google auth and after have a response with the header but now my ktor app redirect me on my back. How Can I do to redirect my client on his app when I send the header please ? (I don’t know if it’s clear, don’t hesitate if you want some code)
    ✅ 1
    d
    • 2
    • 10
  • s

    spand

    07/05/2018, 1:24 PM
    I am right that there is no formdata or urlencoded
    OutgoingContent
    in the client ?
    d
    • 2
    • 3
  • m

    Matt

    07/05/2018, 3:25 PM
    Hullo -- is there any planned support for
    SameSite
    property on cookies in ktor? https://www.owasp.org/index.php/SameSite
    d
    • 2
    • 2
  • n

    Nikky

    07/05/2018, 8:52 PM
    i wonder if routing is not installed or applied ?
    i
    • 2
    • 5
  • j

    jlleitschuh

    07/05/2018, 8:53 PM
    Anyone here have any suggestions for an equivalent in the Kotlin reflection library so I don't need a dependency upon apache commons 3.
    👀 1
    e
    • 2
    • 4
  • c

    coder82

    07/06/2018, 7:40 AM
    I am running on ktor 0.9.3, kotlin 1.2.51
    e
    • 2
    • 4
  • m

    mp

    07/06/2018, 1:08 PM
    What’s your CORS config?
    ✅ 1
    📝 1
    v
    d
    • 3
    • 63
  • d

    danielm

    07/09/2018, 5:00 AM
    I'm trying to get websockets working with a graphql backend (http://graphql-java.readthedocs.io/en/latest/subscriptions.html). How do I have to configure ktor to achieve this? Thanks for any help
    d
    • 2
    • 23
  • m

    Matt

    07/09/2018, 3:22 PM
    I'm migrating our Ktor app to Docker Compose for local development, but I'm struggling to get watch mode working inside the container. It works if I run it directly on my machine, but inside the container I get:
    No ktor.deployment.watch patterns match classpath entries, automatic reload is not active
    Any ideas on what might be the issue? (It's running OpenJDK 1.8 in the container)
    ✅ 1
    c
    • 2
    • 18
  • e

    enleur

    07/09/2018, 3:55 PM
    what do you use for sql queries except Exposed? i like https://github.com/seratch/kotliquery but it looks like an abandoned project
    c
    m
    +2
    • 5
    • 7
  • e

    enleur

    07/09/2018, 3:58 PM
    the same question for DI 🙂 guice is a mature java project, but it uses guava as dependency and does not have fancy kotlin dsl
    c
    m
    +4
    • 7
    • 8
  • d

    dave08

    07/09/2018, 8:01 PM
    @cy That seems closer to my use case, but I don't see how I would use other response types and status codes... my problem is that the client program has a funny and inconsistent api, so I want to abstract things to be able to adapt. I would need to pass the call to an intermediary handler function that translates the controller results into by calling various responseXXX() methods on ApplicationCall
    d
    k
    • 3
    • 18
  • d

    David Marko

    07/09/2018, 8:16 PM
    Hello, what is a proper concept of DI in ktor? For example I’m using kmongo ... how to make database as a singleton object and share it within entire application, all modules etc?
    d
    n
    • 3
    • 2
  • d

    dave08

    07/10/2018, 2:05 AM
    I wonder if Ktor will be implementing micrometer.io metrics, vert.x seemed to do it just for the popularity of Prometheus on Kubernetes https://vertx.io/blog/eclipse-vert-x-metrics-now-with-micrometer-io/
    👍 2
    d
    • 2
    • 91
  • o

    orangy

    07/10/2018, 9:03 AM
    We still somewhat expect that contributions from users could provide frameworks integrations…
    d
    • 2
    • 4
Powered by Linen
Title
o

orangy

07/10/2018, 9:03 AM
We still somewhat expect that contributions from users could provide frameworks integrations…
d

dave08

07/10/2018, 9:49 AM
That's fine, but some things need deeper understanding in the framework, and this is also a fine replacement for the current dropwizard integration.
And we're dependent on the BOSS's decisions as to what efforts to invest in... one day they say go for it, the other 🌩️ ....
That said, you JB guys are doing great work, and it's well appreciated and it's understandable that not everything is possible to do by yourselves 😒imple_smile:
o

orangy

07/10/2018, 11:54 AM
The more you contribute, the better you know framework, and then you can contribute better and faster, and then you can start consulting business on it, and you don’t have a BOSS anymore! 😉
View count: 2