npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

clusterduck-http

v0.1.8

Published

clusterduck-http [![total downloads of clusterduck-http](https://img.shields.io/npm/dt/clusterduck-http.svg)](https://www.npmjs.com/package/clusterduck-http) ======= [![clusterduck-http's License](https://img.shields.io/npm/l/clusterduck-http.svg)](https:

Downloads

11

Readme

clusterduck-http total downloads of clusterduck-http

clusterduck-http's License latest version of clusterduck-http

The HTTP extension for Clusterduck which includes:

Table Of Contents

Installation

Clusterduck is required.

npm i -g clusterduck-http

Configuration

Let's define a HTTP cluster named my_web_cluster:

# clusters:

my_http_cluster:
  type: clusterduck-http

Nodes

Then let's define some nodes:

    # List of nodes
    nodes:
      - addr: 1.1.1.1:80
      - addr: 2.2.2.2:80

Note that you can omit this altogether if you want to only add nodes dynamically.

Health checks

If you do not want to use health checks, use:

    pass_without_checks: true

Otherwise, define the health_checks array:

    health_checks:

WebSocket

      - type: websocket
        timeout: 5s
        every: 10s
        url: wss://your-domain/websocket/
        every: 1000s
        timeout: 20s
        flow:
          - type: expect_json       # Expect a JSON packet
            skip_forward: true      # Ignore prior unexpected packets
            match:                  # Match conditions [path, eq|exists, ?right]
              - [ response.text, eq, "Knock-knock."] 
              - [ timestamp ]       # 'timestamp' field exists

          - type: send_json
            body: {query: {text: "Who's there?"}}

          - type: expect_json
            match:                
              - [ response.text, eq, "Amish."]

          - type: send_json
            body: {query: {text: "Amish who?"}}

          - type: expect_json
            match:                
              - [ response.text, eq, "Really? You don’t look like a shoe!"]

Note that DNS lookups get overridden, so your-domain will be resolved to an IP-address corresponding to one of the nodes in your cluster. However, Host header will be set to your-domain.

HAProxy balancer

HAProxy is required to be installed.

Let's write up a config:

  balancers:

    my_balancer:
      type: haproxy
      listen: 0.0.0.0:443

Note: clusterduck will run haproxy with an according configuration. Hot restarting works out-of-box so that HAProxy is always kept in sync with clusterduck. It requires no middleware or additional configuration.

Debug

For debugging purposes use DEBUG environmental variable: DEBUG=haproxy clusterduck

Dependencies

HAProxy balancer

License

LGPL 3.0 or later.