
Enables real-time bidirectional communication with Phoenix Channels via WebSocket, channel join/leave, push messages, event routing, automatic exponential-backoff reconnection, heartbeat, and type-safe message handling.
A Kotlin client library for Phoenix Channels, enabling real-time bidirectional communication between Kotlin/JVM applications and Phoenix Framework servers.
Supported targets:
iosX64, iosArm64, iosSimulatorArm64)macosX64, macosArm64)tvosX64, tvosArm64, tvosSimulatorArm64)watchosX64, watchosArm32, watchosArm64, watchosDeviceArm64, watchosSimulatorArm64)linuxX64, linuxArm64)mingwX64)implementation("io.github.alexgaribay:kotlin-phoenix-channels:0.1.0")This implementation follows the shape of the official Phoenix client, adapted to Kotlin Multiplatform:
import io.github.alexgaribay.phoenix.Socket
import kotlinx.coroutines.runBlocking
import kotlinx.serialization.json.JsonObject
runBlocking {
val socket = Socket("ws://localhost:4000/socket/websocket")
socket.connect()
val channel = socket.channel("room:lobby")
channel.join()
val reply = channel.push("ping", JsonObject(emptyMap())).await()
println(reply.status)
socket.disconnect()
}This project includes a Phoenix test server for integration testing. See test_server/README.md for details.
# Using Docker Compose (recommended)
docker compose -f test_server/docker-compose.yml up -d
# Or using Gradle
./gradlew startTestServerIf your environment still uses the legacy
docker-composebinary, replacedocker composewithdocker-composein the commands above.
# Default JVM test suite
./gradlew test
# Integration tests only (requires the test server)
./gradlew integrationTestdocker compose -f test_server/docker-compose.yml down
# or
./gradlew stopTestServer./gradlew buildIssues and pull requests are welcome.
A Kotlin client library for Phoenix Channels, enabling real-time bidirectional communication between Kotlin/JVM applications and Phoenix Framework servers.
Supported targets:
iosX64, iosArm64, iosSimulatorArm64)macosX64, macosArm64)tvosX64, tvosArm64, tvosSimulatorArm64)watchosX64, watchosArm32, watchosArm64, watchosDeviceArm64, watchosSimulatorArm64)linuxX64, linuxArm64)mingwX64)implementation("io.github.alexgaribay:kotlin-phoenix-channels:0.1.0")This implementation follows the shape of the official Phoenix client, adapted to Kotlin Multiplatform:
import io.github.alexgaribay.phoenix.Socket
import kotlinx.coroutines.runBlocking
import kotlinx.serialization.json.JsonObject
runBlocking {
val socket = Socket("ws://localhost:4000/socket/websocket")
socket.connect()
val channel = socket.channel("room:lobby")
channel.join()
val reply = channel.push("ping", JsonObject(emptyMap())).await()
println(reply.status)
socket.disconnect()
}This project includes a Phoenix test server for integration testing. See test_server/README.md for details.
# Using Docker Compose (recommended)
docker compose -f test_server/docker-compose.yml up -d
# Or using Gradle
./gradlew startTestServerIf your environment still uses the legacy
docker-composebinary, replacedocker composewithdocker-composein the commands above.
# Default JVM test suite
./gradlew test
# Integration tests only (requires the test server)
./gradlew integrationTestdocker compose -f test_server/docker-compose.yml down
# or
./gradlew stopTestServer./gradlew buildIssues and pull requests are welcome.