github.com/anycable/anycable-go@v1.5.1/Readme.md (about)

     1  [![Latest Release](https://img.shields.io/github/release/anycable/anycable-go.svg?include_prereleases)](https://github.com/anycable/anycable-go/releases/latest?include_prereleases)
     2  [![Build](https://github.com/anycable/anycable-go/workflows/Test/badge.svg)](https://github.com/anycable/anycable-go/actions)
     3  [![Docker](https://img.shields.io/docker/pulls/anycable/anycable-go.svg)](https://hub.docker.com/r/anycable/anycable-go/)
     4  [![Documentation](https://img.shields.io/badge/docs-link-brightgreen.svg)](https://docs.anycable.io/anycable-go/getting_started)
     5  # AnyCable-Go WebSocket Server
     6  
     7  WebSocket server for [AnyCable](https://github.com/anycable/anycable).
     8  
     9  > [AnyCable Pro](https://docs.anycable.io/pro) has been launched 🚀
    10  
    11  ## Versioning
    12  
    13  **Important** Use the same major version of AnyCable-Go as your AnyCable gem.
    14  AnyCable-Go uses the same major version number (and minor version as well for 0.x series) as other libraries to indicate the compatibility.
    15  
    16  ## Installation
    17  
    18  The easiest way to install AnyCable-Go is to [download](https://github.com/anycable/anycable-go/releases) a pre-compiled binary:
    19  
    20  ```shell
    21  # Example for `anycable-go-linux-amd64`
    22  curl -fsSL https://github.com/anycable/anycable-go/releases/latest/download/anycable-go-linux-amd64 -o anycable-go
    23  chmod +x anycable-go
    24  ./anycable-go -v
    25  ```
    26  
    27  MacOS users could install it with [Homebrew](https://brew.sh/)
    28  
    29  ```shell
    30  brew install anycable-go
    31  ```
    32  
    33  Arch Linux users can install [anycable-go package from AUR](https://aur.archlinux.org/packages/anycable-go/).
    34  
    35  Of course, you can install it from source too:
    36  
    37  ```shell
    38  go install github.com/anycable/anycable-go/cmd/anycable-go@latest
    39  ```
    40  
    41  For JavaScript projects, there is also an option to install AnyCable-Go via NPM:
    42  
    43  ```sh
    44  npm install --save-dev @anycable/anycable-go
    45  pnpm install --save-dev @anycable/anycable-go
    46  yarn add --dev @anycable/anycable-go
    47  
    48  # and run as follows
    49  npx anycable-go
    50  ```
    51  
    52  ## Upgrade
    53  
    54  For instructions on how to upgrade to a newer version see [upgrade notes](https://docs.anycable.io/upgrade-notes/Readme.md).
    55  
    56  ### Heroku
    57  
    58  See [heroku-anycable-go](https://github.com/anycable/heroku-anycable-go) buildpack.
    59  
    60  ## Usage
    61  
    62  Run server:
    63  
    64  ```shell
    65  $ anycable-go
    66  
    67  => INFO 2020-02-05T08:44:57.684Z context=main Starting AnyCable 1.1.0
    68  ```
    69  
    70  You can also provide configuration parameters through the corresponding environment variables (i.e. `ANYCABLE_RPC_HOST`, `ANYCABLE_REDIS_URL`, etc).
    71  
    72  For more information about available options run `anycable-go -h`.
    73  
    74  📑 [Documentation](https://docs.anycable.io/anycable-go/getting_started)
    75  
    76  ## Build
    77  
    78  ```shell
    79  # first, prepare mruby (we embed it by default)
    80  # NOTE: Might require running with sudo, since we build artifacts within a Go module
    81  make prepare-mruby
    82  
    83  # then build the Go binary (will be available in dist/anycable-go)
    84  make
    85  ```
    86  
    87  You can run tests with the following commands:
    88  
    89  ```sh
    90  # Run Golang unit tests
    91  make test
    92  
    93  # Run once
    94  make prepare
    95  
    96  # Run integrations tests
    97  make test-conformance
    98  
    99  # Run integration benchmarks
   100  go install github.com/anycable/websocket-bench@latest
   101  make benchmarks
   102  ```
   103  
   104  We use [golangci-lint](https://golangci-lint.run) to lint Go source code:
   105  
   106  ```sh
   107  make lint
   108  ```
   109  
   110  ## Docker
   111  
   112  See available images [here](https://hub.docker.com/r/anycable/anycable-go/).
   113  
   114  ## Contributing
   115  
   116  Bug reports and pull requests are welcome on GitHub at [https://github.com/anycable/anycable-go](https://github.com/anycable/anycable-go).
   117  
   118  Please, provide reproduction script (using [this template](https://github.com/anycable/anycable/blob/master/etc/bug_report_template.rb)) when submitting bugs if possible.
   119  
   120  ## License
   121  
   122  The library is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
   123  
   124  ## Security Contact
   125  
   126  To report a security vulnerability, please contact us at `anycable@evilmartians.com`. We will coordinate the fix and disclosure.