https://github.com/gsmlg-dev/abyss
Abyss is a pure Elixir UDP server
https://github.com/gsmlg-dev/abyss
Last synced: 12 months ago
JSON representation
Abyss is a pure Elixir UDP server
- Host: GitHub
- URL: https://github.com/gsmlg-dev/abyss
- Owner: gsmlg-dev
- License: mit
- Created: 2025-02-21T03:15:11.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-29T16:53:39.000Z (about 1 year ago)
- Last Synced: 2025-05-29T19:32:53.465Z (about 1 year ago)
- Language: Elixir
- Homepage:
- Size: 126 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Abyss
[](https://github.com/gsmlg-dev/abyss/actions/workflows/release.yml)
[](https://hex.pm/packages/abyss)
[](https://hexdocs.pm/abyss)
---
## Installation
The package can be installed by adding `abyss` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[
{:abyss, "~> 0.1.0"}
]
end
```
## Run Example
```shell
# run service
mix run --no-halt -e 'Code.require_file("example/echo.ex"); Abyss.Logger.attach_logger(:trace); Abyss.start_link(handler_module: Echo, port: 1234); Process.sleep(3600_000 * 24); '
mix run --no-halt -e 'Abyss.Logger.attach_logger(:trace); Abyss.start_link(handler_module: Abyss.Echo, port: 1234); Process.sleep(3600_000 * 24); '
# test
while true
do
echo "Hello, UDP $(date +%T)" | nc -4 -u -w1 127.0.0.1 1234
done
```
Listen `broadcast`
DHCP
```shell
mix run --no-halt -e 'Code.require_file("example/dump.ex"); Abyss.Logger.attach_logger(:trace); Abyss.start_link(handler_module: Dump, port: 67, transport_options: [broadcast: true, multicast_if: {255, 255, 255, 255}]); Process.sleep(3600_000 * 24) '
```
mDNS
```shell
mix run --no-halt -e 'Code.require_file("example/dump_mdns.ex"); Abyss.Logger.attach_logger(:trace); Abyss.start_link(handler_module: DumpMDNS, port: 5353, transport_options: [broadcast: true, multicast_if: {224, 0, 0, 251}]); Process.sleep(3600_000 * 24) '
# or
mix run --no-halt -e 'Code.require_file("example/dump_mdns.ex"); Abyss.start_link(handler_module: DumpMDNS, port: 5353, transport_options: [broadcast: true, multicast_if: {224, 0, 0, 251}]); Process.sleep(3600_000 * 24) '
```