Samples are a series of self-contained applications that can you browse through to understand different ways to accomplish things in Ktor.
- Chat Application. Ktor application using web sockets and sessions to simulate a chat application.
- Running Ktor with GraalVM. Run a Ktor Server application which uses a CIO engine, with GraalVM
- CSS DSL. Using Kotlin CSS in combination with Ktor.
- Kodein DI. Using Kodein Dependency Injection framework with Ktor.
- File Listing. How to create a file listing for a static site.
- HTTP Bin. An implemention of HttpBin using Ktor, demonstrating the majority of endpoints and functionality available.
- Kweet. A messaging application simulating Twitter, and using Freemarker template engine.
- Location Header. Demonstrating how to use HTTP Location header.
- Google AppEngine. Deploying a Ktor application to Google AppEngine, using Maven as the build tool.
- Maven and Netty. Using Maven to create an self-contained Netty Ktor server.
- Multiple Connectors. Showcasing how to create endpoints listening on different IPs and ports in a single Ktor application.
- Proguard. Sample on how to use Proguard with Ktor.
- Redirect with Exception. Creating an HTTP direct when an exception is thrown.
- Reverse Proxy. A Reverse Proxy implementation.
- Reverse Proxy with WebSockets. A Reverse Proxy implementation which uses WebSockets.
- RxJava. How to use RxJava in combination with Ktor.
- Slow server simulation. Simulating a slow server using a custom interceptor.
- Server Side Events. Using Server-Side Events to trigger callbacks on the client.
- Structured Logging. Demonstrates how to log applications calls during the different phases of request and response pipeline.
- YouKube. Demonstrates how to create an application that allows for uploading and viewing of videos, using Kotlinx.html as the templating engine.
- Native Client. A native HTTP client using libcurl and Kotlin/Native.
- Client Multipart. Ktor client that can send multipart data.