All Projects → ibrahimsn98 → Achilles

ibrahimsn98 / Achilles

Licence: mit
A Simple Retrofit Inspired Android Websocket Client (In Development)

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to Achilles

Beast
HTTP and WebSocket built on Boost.Asio in C++11
Stars: ✭ 3,241 (+8659.46%)
Mutual labels:  websockets, websocket-client
Sockpuppet
Having fun with WebSockets, Python, Golang and nytimes.com
Stars: ✭ 32 (-13.51%)
Mutual labels:  websockets, websocket-client
Websocket Client
🔧 .NET/C# websocket client library
Stars: ✭ 297 (+702.7%)
Mutual labels:  websockets, websocket-client
Awesome Websockets
A curated list of Websocket libraries and resources.
Stars: ✭ 850 (+2197.3%)
Mutual labels:  websockets, websocket-client
Ulfius
Web Framework to build REST APIs, Webservices or any HTTP endpoint in C language. Can stream large amount of data, integrate JSON data with Jansson, and create websocket services
Stars: ✭ 666 (+1700%)
Mutual labels:  websockets, websocket-client
LazWebsockets
Websocket Server and Client Library written in Lazarus
Stars: ✭ 51 (+37.84%)
Mutual labels:  websockets, websocket-client
Websockets
Library for building WebSocket servers and clients in Python
Stars: ✭ 3,724 (+9964.86%)
Mutual labels:  websockets, websocket-client
general-angular
Realtime Angular Admin/CRUD Front End App
Stars: ✭ 24 (-35.14%)
Mutual labels:  websockets, websocket-client
Pawl
Asynchronous WebSocket client
Stars: ✭ 448 (+1110.81%)
Mutual labels:  websockets, websocket-client
Java Slack Sdk
Slack Developer Kit (including Bolt for Java) for any JVM language
Stars: ✭ 393 (+962.16%)
Mutual labels:  websockets, websocket-client
reactive-streams-for-java-developers
No description or website provided.
Stars: ✭ 16 (-56.76%)
Mutual labels:  websockets, websocket-client
Starscream
Websockets in swift for iOS and OSX
Stars: ✭ 7,105 (+19102.7%)
Mutual labels:  websockets, websocket-client
EthernetWebServer
This is simple yet complete WebServer library for AVR, Portenta_H7, Teensy, SAM DUE, SAMD21/SAMD51, nRF52, STM32, RP2040-based, etc. boards running Ethernet shields. The functions are similar and compatible to ESP8266/ESP32 WebServer libraries to make life much easier to port sketches from ESP8266/ESP32. Coexisting now with `ESP32 WebServer` and…
Stars: ✭ 118 (+218.92%)
Mutual labels:  websockets, websocket-client
Node Slack Sdk
Slack Developer Kit for Node.js
Stars: ✭ 2,988 (+7975.68%)
Mutual labels:  websockets, websocket-client
text
An experiment with WebSockets and the human condition.
Stars: ✭ 51 (+37.84%)
Mutual labels:  websockets, websocket-client
Python Slack Sdk
Slack Developer Kit for Python
Stars: ✭ 3,307 (+8837.84%)
Mutual labels:  websockets, websocket-client
System.Net.WebSockets.Client.Managed
Microsoft's managed implementation of System.Net.WebSockets.ClientWebSocket tweaked for use on Windows 7 and .NET 4.5
Stars: ✭ 41 (+10.81%)
Mutual labels:  websockets, websocket-client
remoting
Jetlang Remoting - asynchronous distributed messaging
Stars: ✭ 27 (-27.03%)
Mutual labels:  websockets, websocket-client
Saea
SAEA.Socket is a high-performance IOCP framework TCP based on dotnet standard 2.0; Src contains its application test scenarios, such as websocket,rpc, redis driver, MVC WebAPI, lightweight message server, ultra large file transmission, etc. SAEA.Socket是一个高性能IOCP框架的 TCP,基于dotnet standard 2.0;Src中含有其应用测试场景,例如websocket、rpc、redis驱动、MVC WebAPI、轻量级消息服务器、超大文件传输等
Stars: ✭ 318 (+759.46%)
Mutual labels:  websockets, websocket-client
Gun
HTTP/1.1, HTTP/2 and Websocket client for Erlang/OTP.
Stars: ✭ 710 (+1818.92%)
Mutual labels:  websockets, websocket-client

Achilles

A Simple Retrofit, Scarlet Inspired Android Websocket Client

API Android Arsenal Android CI

Motivation

I have created this library to communicate the apps with their own backends. All receiver and send methods require to specify event name, so both client and server applications distinguish the right payload.

Payload

  • Data sent
{"event": "echo", "data": {"name": "Mark", "surname": "Bond"}}
  • Data sent (Encoded payload)
{"event": "echo", "data": "eyJuYW1lIjogIk1hcmsiLCAic3VybmFtZSI6ICJCb25kIn0="}
  • Data received
{"event": "echo", "data": {"name": "Mark", "surname": "Bond"}}

Usage

  • Create service interface
interface SocketService {

    @SendEvent("echo")
    fun sendEcho(
        @Field("name") name: String,
        @Field("surname") surname: String
    )

    @ReceiveEvent("echo")
    suspend fun receiveEcho(): Flow<Response>
}
  • Use Achilles to create an implementation:
val achilles = Achilles.Builder()
    .baseUrl("wss://echo.websocket.org")
    .client(OkHttpClient().newBuilder().build())
    .encodePayload(true)
    .logTraffic(true)
    .build()

val service = achilles.create(SocketService::class.java)
  • Send and observe socket event data
CoroutineScope(IO).launch {
    service.receiveEcho().onEach {
        Log.d("MainActivity", "Response: $it")
    }

    service.sendEcho("Name", "Surname")
}

Setup

allprojects {
	repositories {
		...
		maven { url 'https://jitpack.io' }
	}
}

dependencies {
    implementation 'com.github.ibrahimsn98:achilles:1.4'
}

TODO

  • [ ] Lifecycle aware connection
  • [ ] Reconnect on disconnection
  • [ ] Socket status events
  • [ ] Payload encryption

License

MIT License

Copyright (c) 2019 İbrahim Süren

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].