All Projects → WallarooLabs → Phoenix_tcp

WallarooLabs / Phoenix_tcp

Licence: other
TCP transport layer for Phoenix

Programming Languages

elixir
2628 projects

Projects that are alternatives of or similar to Phoenix tcp

Tcp Connection Hijack Reset
Simple scapy-based tool to hijack and reset existing TCP connections
Stars: ✭ 17 (-41.38%)
Mutual labels:  tcp
Tcpmessenger
TCPMessenger is a lightweight and simple Android library to send and receive tcp messages.
Stars: ✭ 12 (-58.62%)
Mutual labels:  tcp
Tk Listen
A library that allows to listen network sockets with proper resource limits and error handling
Stars: ✭ 27 (-6.9%)
Mutual labels:  tcp
Simpleunitytcp
🖧 Simple Unity Project to show how TCP communication are builded in C# without multi-threading or Unity network (Unet) involved.
Stars: ✭ 22 (-24.14%)
Mutual labels:  tcp
Skillbox Chat 08 19
Skillbox demo application for the Python course
Stars: ✭ 25 (-13.79%)
Mutual labels:  tcp
Inquisitor jsonapi
JSON API Matchers for Inquisitor
Stars: ✭ 13 (-55.17%)
Mutual labels:  phoenix
Drab
Remote controlled frontend framework for Phoenix.
Stars: ✭ 833 (+2772.41%)
Mutual labels:  phoenix
Platform
[Archived] Demo application for Elixir and Elm Tutorial.
Stars: ✭ 29 (+0%)
Mutual labels:  phoenix
T2q2t
TCP/QUIC port forward tool
Stars: ✭ 26 (-10.34%)
Mutual labels:  tcp
Guardian auth
The Guardian Authentication Implementation Using Ecto/Postgresql Elixir Phoenix [ User Authentication ]
Stars: ✭ 15 (-48.28%)
Mutual labels:  phoenix
Scalecube Services
v2.0 - ScaleCube Services provides a low latency Reactive Microservices library for serverless service registry and discovery based on gossip protocol and without single point-of-failure or bottlenecks.
Stars: ✭ 23 (-20.69%)
Mutual labels:  tcp
Dpdk Ans
ANS(Accelerated Network Stack) on DPDK, DPDK native TCP/IP stack.
Stars: ✭ 925 (+3089.66%)
Mutual labels:  tcp
Analytics
Simple, open-source, lightweight (< 1 KB) and privacy-friendly web analytics alternative to Google Analytics.
Stars: ✭ 9,469 (+32551.72%)
Mutual labels:  phoenix
Bigq
Messaging platform in C# for TCP and Websockets, with or without SSL
Stars: ✭ 18 (-37.93%)
Mutual labels:  tcp
Liberator
An Elixir library for building RESTful applications.
Stars: ✭ 28 (-3.45%)
Mutual labels:  phoenix
Karma werks
A project management tool created with Elixir, Phoenix and Dgraph
Stars: ✭ 17 (-41.38%)
Mutual labels:  phoenix
Phoenix
Mirror of Apache Phoenix
Stars: ✭ 867 (+2889.66%)
Mutual labels:  phoenix
Goridge
High-performance PHP-to-Golang IPC bridge
Stars: ✭ 950 (+3175.86%)
Mutual labels:  tcp
Zeus
A high performance, cross-platform Internet Communication Engine. Developed with native socket API. Aim at handling millions of concurrent connections.
Stars: ✭ 30 (+3.45%)
Mutual labels:  tcp
Tinytcpserver
A small tcp server working under Mono or .NET (4.0) and provides hooks for handling data exchange with clients (works under mono and .net). Behaviour/protocol/reaction could be specified via custom C# script.
Stars: ✭ 14 (-51.72%)
Mutual labels:  tcp

PhoenixTCP

POC TCP Transport for the Phoenix Framework

Installation

If available in Hex, the package can be installed as:

  1. Add phoenix_tcp to your list of dependencies in mix.exs:

    def deps do [{:phoenix_tcp, "~> 0.0.1"}] [{:phoenix_tcp, git: "[email protected]:sendence/phoenix_tcp.git", tag: "v0.0.1"}] end

Setup

  1. In your application file add the following as a child after your endpoint: supervisor(PhoenixTCP.Supervisor, [:app_name, Chat.Endpoint])

  2. In your config.ex add to your endpoints config: tcp_handler: PhoenixTCP.RanchHandler, tcp: [port: System.get_env("PHX_TCP_PORT") || 5001]

  3. In your socket(s) add the following: transport :tcp, PhoenixTCP.Transports.TCP

Usage

in order to send data to Phoenix over TCP using this transport, the data must be sent in binary format. The first 4 bytes will be used to determine the message size and the remaining bytes will be the message. Ex. using Elixir:

iex> opts = [:binary, active: false]
[:binary, {:active, false}]
iex> {:ok, socket} = :gen_tcp.connect('localhost', 5001, opts)
{:ok, #Port<0.5652>}
iex> path = "{\"path\": \"/socket/tcp\", \"params\": {}}"
"{\"path\": \"/socket/tcp\", \"params\": {}}"
iex> path_msg = << byte_size(path) :: size(32) >> <> path
<<0, 0, 0, 37, 123, ... 125, 125>>
iex> :tcp_send(socket, path_msg)
...

The server initially expects to receive the following message in json: {"path": "/:path", "params": {}}

once a connection is established, the standard Phoenix join event is expected (a ref must be passed): {"event": "phx_join", "topic": "topic-name", "payload": null, "ref": null}

and subsequent messages are sent after the join is established in the same structure: {"event": ..., "topic": ..., "payload": ..., "ref": ...}

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].