First Commit 29/07/2025
This commit is contained in:
8
src/Main.kt
Normal file
8
src/Main.kt
Normal file
@@ -0,0 +1,8 @@
|
||||
import zello.ZelloClient
|
||||
|
||||
//TIP To <b>Run</b> code, press <shortcut actionId="Run"/> or
|
||||
// click the <icon src="AllIcons.Actions.Execute"/> icon in the gutter.
|
||||
fun main() {
|
||||
val z = ZelloClient.fromConsumerZello()
|
||||
|
||||
}
|
||||
46
src/zello/ZelloClient.kt
Normal file
46
src/zello/ZelloClient.kt
Normal file
@@ -0,0 +1,46 @@
|
||||
package zello
|
||||
|
||||
import org.java_websocket.client.WebSocketClient
|
||||
import org.java_websocket.handshake.ServerHandshake
|
||||
import java.lang.Exception
|
||||
import java.net.URI
|
||||
|
||||
@Suppress("unused")
|
||||
class ZelloClient(address : URI) : WebSocketClient(address) {
|
||||
companion object {
|
||||
fun fromConsumerZello() : ZelloClient {
|
||||
return ZelloClient(URI.create("wss://zello.io/ws"))
|
||||
}
|
||||
|
||||
fun fromZelloWork(networkName : String) : ZelloClient{
|
||||
return ZelloClient(URI.create("wss://zellowork.io/ws/$networkName"))
|
||||
}
|
||||
|
||||
fun fromZelloEnterpriseServer(serverDomain: String) : ZelloClient{
|
||||
return ZelloClient(URI.create("wss://$serverDomain/ws/mesh"))
|
||||
}
|
||||
}
|
||||
|
||||
// this key is temporary, valid only 30 days from 2025-07-29
|
||||
// if need to create, from https://developers.zello.com/keys
|
||||
private val developerKey : String = "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJXa002Y21ScllYSjBiMjV2T2pFLi1yYjJ2THFRbUhYV3dKY2I2azl2TDdUMEtzRWZMRjcxZm5jcktTZ0s2ZE0iLCJleHAiOjE3NTY0MzIyMTIsImF6cCI6ImRldiJ9.ANK7BIS6WVVWsQRjcZXyGWrV2RodCUQD4WXWaA6E4Dlyy8bBCMFdbiKN2D7B_x729HQULailnfRhbXF4Avfg14qONdc1XE_0iGiPUO1kfUSgdd11QylOzjxy6FTKSeZmHOh65JZq2dIWxobCcva-RPvbR8TA656upHh32xrWv9zlU0N707FTca04kze0Iq-q-uC5EL82yK10FEvOPDX88MYy71QRYi8Qh_KbSyMcYAhe2bTsiyjm51ZH9ntkRHd0HNiaijNZI6-qXkkp5Soqmzh-bTtbbgmbX4BT3Qpz_IP3epaX3jl_Aq5DHxXwCsJ9FThif9um5D0TWVGQteR0cQ"
|
||||
override fun onOpen(handshakedata: ServerHandshake?) {
|
||||
TODO("Not yet implemented")
|
||||
|
||||
}
|
||||
|
||||
override fun onMessage(message: String?) {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
override fun onClose(code: Int, reason: String?, remote: Boolean) {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
override fun onError(ex: Exception?) {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user