Giter VIP home page Giter VIP logo

rsintercept's Introduction

rsintercept

An upstream http proxy that supports websockets.

Usage

CLI upstream http/ws proxy

Usage: rsintercept [OPTIONS] --upstream-address <UPSTREAM_ADDRESS>

Options:
  -u, --upstream-address <UPSTREAM_ADDRESS>
          Upstream host address
  -l, --bind-address <BIND_ADDRESS>
          Bind address [default: 127.0.0.1:8080]
  -p, --prometheus-bind-address <PROMETHEUS_BIND_ADDRESS>
          Prometheus bind address [default: 127.0.0.1:9100]
      --trim <TRIM_LEVEL>
          Number of path segments to keep in metrics, 0 keeps all [default: 0]
      --http-host <HTTP_HOST>
          Host http header to use for upstream, it is left untouched by default
  -s, --ignore-status <IGNORE_STATUS>
          If specified, metrics will not include requests for which the response status is this code
      --tls-cert <TLS_CERT>
          tls certificate path
      --tls-pkey <TLS_PKEY>
          tls private key path
  -v, --verbose
          print websocket messages to stdout
  -j, --print-ip
          print connecting IP to stdout
      --drop-headers <DROP_HEADERS>...
        
  -h, --help
          Print help
  -V, --version
          Print version

Metrics

The proxy exposes prometheus metrics that include the number of websocket messages received by the client, labled by the request path. For example:

# HELP rs_intercept_non_websocket_total Total HTTP requests forwarded that were not websocket
# TYPE rs_intercept_non_websocket_total counter
rs_intercept_non_websocket_total{path="/abc"} 2
rs_intercept_non_websocket_total{path="/def"} 1
rs_intercept_non_websocket_total{path="/hello"} 1
rs_intercept_non_websocket_total{path="/some-path"} 1
# HELP rs_intercept_websocket_messages_total Total WebSocket messages
# TYPE rs_intercept_websocket_messages_total counter
rs_intercept_websocket_messages_total{path="/"} 14
rs_intercept_websocket_messages_total{path="/abc"} 8
rs_intercept_websocket_messages_total{path="/abcdef"} 15
rs_intercept_websocket_messages_total{path="/some-path"} 19
# HELP rs_intercept_websocket_sessions_total Total WebSocket sessions
# TYPE rs_intercept_websocket_sessions_total counter
rs_intercept_websocket_sessions_total{path="/"} 1
rs_intercept_websocket_sessions_total{path="/abc"} 1
rs_intercept_websocket_sessions_total{path="/abcdef"} 2
rs_intercept_websocket_sessions_total{path="/some-path"} 1

Example usage

cargo run --release -- -u ws.ifelse.io:80 --http-host ws.ifelse.io

rsintercept's People

Contributors

cabbache avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.