anycable-go

module
v1.5.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 21, 2024 License: MIT

README

Latest Release Build Docker Documentation

AnyCable WebSocket Server

A real-time server component of AnyCable (open-source edition). Check out also our Pro and managed offerings.

[!NOTE] You can find all the necessary information about AnyCable in our documentation: docs.anycable.io.

Installation

There are several ways to install AnyCable server:

  • On MacOS, you can install AnyCable via Homebrew:

    brew install anycable-go
    
  • Docker images are available on Docker Hub.

  • For Rails projects, we recommend using our bin/rails g anycable:bin installer for local development.

  • For JavaScript projects, we recommend installing AnyCable via NPM:

    npm install --save-dev @anycable/anycable-go
    pnpm install --save-dev @anycable/anycable-go
    yarn add --dev @anycable/anycable-go
    
    # and run as follows
    npx anycable-go
    
  • You can use heroku-anycable-go buildpack for Heroku deployments.

  • Arch Linux users can install anycable-go package from AUR.

  • Or you can download a binary from the releases page:

    # Example for `anycable-go-linux-amd64`
    curl -fsSL https://github.com/anycable/anycable-go/releases/latest/download/anycable-go-linux-amd64 -o anycable-go
    chmod +x anycable-go
    ./anycable-go -v
    
  • Of course, you can install it from source too:

    go install github.com/anycable/anycable-go/cmd/anycable-go@latest
    

Usage

Run server:

$ anycable-go

2024-10-09 11:00:01.402 INF Starting AnyCable 1.5.3-f39ff3f (pid: 85844, open file limit: 122880, gomaxprocs: 8) nodeid=E4eFyM

For more information about available options run anycable-go -h or check out the documentation.

Build

# first, prepare mruby (we embed it by default)
# NOTE: Might require running with sudo, since we build artifacts within a Go module
make prepare-mruby

# then build the Go binary (will be available in dist/anycable-go)
make

You can run tests with the following commands:

# Run Golang unit tests
make test

# Run once
make prepare

# Run integrations tests
make test-conformance

# Run integration benchmarks
go install github.com/anycable/websocket-bench@latest
make benchmarks

We use golangci-lint to lint Go source code:

make lint

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/anycable/anycable-go.

Please, provide reproduction script (using this template) when submitting bugs if possible.

License

The library is available as open source under the terms of the MIT License.

Security Contact

To report a security vulnerability, please contact us at anycable@evilmartians.com. We will coordinate the fix and disclosure.

Directories

Path Synopsis
This package contains different message broadcast handler implemenentations.
This package contains different message broadcast handler implemenentations.
cmd
anycable-go command
embedded-cable command
gobench-cable command
Package common contains struts and interfaces shared between multiple components
Package common contains struts and interfaces shared between multiple components
Package gobench implements alternative controller for benchmarking Go server w/o RPC.
Package gobench implements alternative controller for benchmarking Go server w/o RPC.
Package stats contains calculation utils for benchmarks Based on https://github.com/anycable/websocket-bench/blob/master/benchmark/stat.go
Package stats contains calculation utils for benchmarks Based on https://github.com/anycable/websocket-bench/blob/master/benchmark/stat.go
This package provides functionality to directly subscribe to streams without using channels (a simplified pub/sub mode)
This package provides functionality to directly subscribe to streams without using channels (a simplified pub/sub mode)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL