balancer

Version, currently 0.33 versions

github.com/kostya/balancer

Simple Tcp Balancer

9 stars
0 dependents
License: MIT

Installation

# Add this to your shard.yml
dependencies:
  balancer:
    github: kostya/balancer
    version: ~> 0.3

Then run:

shards install

shard.yml

Crystal
>= 0.22.0
License
MIT
Author
Konstantin Makarchev <kostya27@gmail.com>

Dependencies

This version declares no dependencies.

README

# balancer

Simple Tcp Balancer (when nginx or haproxy too heavy for your tasks)

## Installation

Add this to your application's `shard.yml`:

```yaml
dependencies:
  balancer:
    github: kostya/balancer
```

## Usage

```crystal
require "balancer"

# run balancer listen on 0.0.0.0:3000
# and proxing all connections to 127.0.0.1:3001..3010
balancer = Balancer.new("0.0.0.0", 3000, "127.0.0.1", 3001..3010, Balancer::Method::RoundRobin)
balancer.run
```