https://kotlinlang.org logo
Docs
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
  • f

    frellan

    11/01/2018, 10:48 AM
    I just upgraded ktor, i now get that this
    val config = HoconApplicationConfig(ConfigFactory.load())
    is an experimental API, what is the correct way to load the application,conf now?
    d
    • 2
    • 1
  • v

    Vinicius Carvalho

    11/01/2018, 2:03 PM
    Hi all, is there any chance we get the distribution of ktor on maven central or jcenter? I have been trying to bootstrap a ktor community in my company by we have strict rules to not mirror any other repo besides central and jcenter.
    j
    s
    +2
    • 5
    • 26
  • d

    dimkoss11

    11/04/2018, 5:02 PM
    hi, how use Ktor with netty client type?
    🤔 1
    s
    e
    • 3
    • 5
  • j

    jcechace

    11/05/2018, 8:09 AM
    how do I actually configurate OkHttp things such as sslSocketFactory?
    d
    • 2
    • 3
  • d

    dimkoss11

    11/05/2018, 8:14 AM
    What about https://github.com/ktorio/ktor/issues/321 ? I have Error occurred during initialization of boot layer java.lang.module.ResolutionException: Modules ktor.server.core and ktor.http.jvm export package io.ktor.http to module ktor.network with quickstart gradle tutorial
    e
    • 2
    • 4
  • s

    Sergio Casero

    11/05/2018, 10:14 AM
    Hi! I'm getting an issue with the ktor client, when I try to make a post request, throws a rare error:
    override suspend fun addLocation(location: Location): Unit = <http://client.post|client.post> {
            path(LOCATION)
            body = location
        }
    It throws
    java.lang.ClassCastException: com.sergiocasero.model.Location cannot be cast to io.ktor.client.call.HttpClientCall
    My first impression was a problem with the serializer, but
    override suspend fun getLocation(parent: Int): Location =
                client.get<Location> { path("$LOCATION/$parent") }
    works perfect, the model is quite simple:
    @Serializable
    data class Location(
            val id: Int,
            val parentId: Int,
            val name: String
    )
    Any suggestions?
    e
    • 2
    • 7
  • d

    dave08

    11/05/2018, 11:10 AM
    Did anything change from Ktor 0.9.5 -> 1.0.0-beta-3 for TestApplication tests? Suddenly all my tests fail after upgrading...
    d
    v
    m
    • 4
    • 62
  • r

    Riccardo Montagnin

    11/06/2018, 10:06 AM
    Hello everyone, how can I authenticate a user that tries to access a Webserver?
    d
    • 2
    • 4
  • k

    krotki

    11/06/2018, 12:37 PM
    Hello, I'm trying to use ktor-client 1.0.0-beta3 with apache and kotlin 1.3.0, but during the execution i'm getting
    Exception in thread "main" java.lang.NoClassDefFoundError: kotlinx/coroutines/io/ByteChannelKt
    . I searched coroutines lib and I can't find this class. Is there any special dependency that I'm missing ?
    m
    • 2
    • 3
  • t

    Tsvetozar Bonev

    11/06/2018, 1:00 PM
    When using Koin alongside Ktor how do I enable autoreload? I can't use the commandLineEnvironment parameter alongside the watchlist and not using commandLineEnvironment makes koin crash. I have an application.conf file that defines the package to watch but I can't seem to make it actually reload.
    d
    • 2
    • 2
  • d

    dave08

    11/06/2018, 2:55 PM
    The multiple connectors example in the docs has:
    fun Application.main() {
        routing {
            get("/") {
                if (call.request.local.port == 8080) {
                    call.respondText("Connected to public api")
                } else {
                    call.respondText("Connected to private api")
                }
            }
        }
    }
    I think no one would want to handle internal/external apis in this way... is there a way to do:
    fun Application.main() {
        routing {
          port(8080) {
            get("/") {
                    call.respondText("Connected to public api")
            }
         }
         port(9090) {
            get("/") {
                    call.respondText("Connected to private api")
            }
         }
        }
    }
    ?
    d
    • 2
    • 4
  • p

    patjackson52

    11/06/2018, 3:13 PM
    Anyone running into compile errors with this message? skipping …/ktor-client-ios.klib. The compiler versions don’t match. Expected ‘[0.9.3]’, found ‘1.0.1-release-4583’ There was an open issue, but the I am still getting it. On Kotlin 1.3.0, ktor 1.0.0-beta-3, konan 0.9.3
    d
    e
    • 3
    • 4
  • c

    coder82

    11/06/2018, 4:37 PM
    message has been deleted
    c
    • 2
    • 4
  • t

    tw

    11/07/2018, 11:11 AM
    has anyone figure out a nice way to read the request body more than once in ktor - for example, for logging purposes?
    e
    • 2
    • 2
  • c

    coder82

    11/07/2018, 2:21 PM
    the pipeline context is not available there yet, right?
    s
    • 2
    • 1
  • g

    gaetan

    11/07/2018, 4:01 PM
    I have some weird behaviour with kotlinx.html generated pages that are not complete. Did somebody experienced that?
    m
    o
    • 3
    • 12
  • o

    orangy

    11/07/2018, 4:33 PM
    📣 Can you folks share what you like most about Ktor, and what least? Just one-two sentences in a thread. Thinking about what to highlight in the release blog post.
    m
    r
    +5
    • 8
    • 10
  • o

    orangy

    11/07/2018, 4:39 PM
    📣 Also if someone has ktor in production with some impressive (relative, I know, but still) numbers/experience, we could discuss featuring it in the blog post.
    s
    k
    s
    • 4
    • 4
  • o

    orangy

    11/07/2018, 4:42 PM
    @mp re pipeline issues, can you elaborate in this separate thread, please?
    m
    v
    g
    • 4
    • 5
  • t

    tomreay

    11/07/2018, 5:38 PM
    Following up on this - I'm trying to get this to work, the example kindly given seems to be for ktor-client, on the server side
    proceed
    and
    proceedWith
    both take
    Unit
    . I'm trying to read the request body in to use in request signing as part of an authorisation flow - I wonder if there is a better way of accomplishing this? (me and @twwork together - fyi)
    v
    • 2
    • 2
  • m

    mp

    11/07/2018, 6:04 PM
    Let me guess, more oauth 1-related suffering? 🙂
    t
    • 2
    • 1
  • n

    napperley

    11/08/2018, 12:40 AM
    Is there a way to easily switch between development and production environments without moving static assets around? Have some static assets which load fine during development but aren't being loaded in the production environment (from a Fat JAR).
    d
    • 2
    • 3
  • a

    Allan Wang

    11/09/2018, 2:50 AM
    Has anyone gotten ktor v1.0.0-beta-3 working with multiplatform? I tried it and I’m getting a coroutine related error with SuccessOrFailure. Relevant issue: https://github.com/ktorio/ktor/issues/669#issuecomment-437231989
    🤔 1
    e
    a
    • 3
    • 6
  • o

    orangy

    11/09/2018, 9:34 AM
    @samir re your feedback on type-safe routing. we will be working on type-safe routing after v1.0 release. For now Locations are marked experimental because we are not quite satisfied with them too. If you could submit an issue on it with some use cases, it would be nice!
    s
    s
    • 3
    • 8
  • o

    orangy

    11/09/2018, 9:40 AM
    @russhwolf @mp re “JsonFeature automatically grabs a default serializer based on what gradle includes you have.” – can you elaborate on what is the problem? AFAIK it works this way only when you tell it to work like this, i.e. using
    defaultSerializer
    .
    m
    r
    • 3
    • 2
  • e

    enleur

    11/09/2018, 9:45 AM
    Not sure if it’s related to this channel. I’m doing caching so If I want to save some data classes to redis and share this cache among multiple web services. Should I use kotlinx.serialization CBOR, Json or something like Kryo?
    o
    • 2
    • 1
  • s

    spand

    11/09/2018, 12:13 PM
    What are the remaining issues for the 1.0 release ? I mean there a quite a lot of open issues in the tracker so I presume its not going to be all of them. Personally I am interested in the > java8 support.
    o
    m
    • 3
    • 2
  • t

    tweissbeck

    11/09/2018, 1:39 PM
    #ktor My IDE do not found class HttpClient with ktor-client 1.0.0-beta-3 This class can only be found with version 0.9.3, any issue with manifest generation after 0.9.3+ ? (gradle build fail aswell) (modifié)
    e
    • 2
    • 1
  • a

    adeln

    11/10/2018, 7:03 AM
    for some reason after upgrading to
    1.0.0-beta-3
    I’m getting
    Exception in thread "nettyWorkerPool-3-3" java.lang.NoClassDefFoundError: Could not initialize class kotlinx.coroutines.io.ByteBufferChannel
            at kotlinx.coroutines.io.ByteChannelKt.ByteChannel(ByteChannel.kt:13)
            at kotlinx.coroutines.io.ByteChannelKt.ByteChannel$default(ByteChannel.kt:38)
            at kotlinx.coroutines.io.ByteReadChannel$Companion$Empty$2.invoke(ByteReadChannelJVM.kt:200)
            at kotlinx.coroutines.io.ByteReadChannel$Companion$Empty$2.invoke(ByteReadChannelJVM.kt:199)
            at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
            at kotlinx.coroutines.io.ByteReadChannel$Companion.getEmpty(ByteReadChannelJVM.kt)
            at io.ktor.server.netty.http1.NettyHttp1Handler.handleRequest(NettyHttp1Handler.kt:45)
            at io.ktor.server.netty.http1.NettyHttp1Handler.channelRead(NettyHttp1Handler.kt:29)
            at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
            at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
            at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
            at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86)
            at io.netty.handler.codec.http.HttpServerExpectContinueHandler.channelRead(HttpServerExpectContinueHandler.java:95)
            at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
            at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
            at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
            at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:438)
            at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:310)
            at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:284)
            at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:253)
            at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
            at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
            at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
            at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1434)
            at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
            at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
            at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:965)
            at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163)
            at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:645)
            at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:580)
            at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:497)
            at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:459)
            at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:884)
            at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
            at java.lang.Thread.run(Thread.java:748)
    e
    • 2
    • 3
  • c

    carolos

    11/10/2018, 2:35 PM
    I am getting: Cannot find module 'ktor-client-core-js'
    e
    • 2
    • 1
Powered by Linen
Title
c

carolos

11/10/2018, 2:35 PM
I am getting: Cannot find module 'ktor-client-core-js'
e

e5l

11/12/2018, 5:23 AM
Could you provide the
dependencies
section of your
build.gradle
script?
View count: 2