Code Monkey home page Code Monkey logo

wasm-filters's Introduction

GitHub contributors GitHub GitHub issues by-label Slack Twitter Follow

WebAssembly Filters for Envoy

A collection of WebAssemby filters for Envoy proxy written in C,C++,C# and Rust for exercising different features provided by envoy-wasm.

See the Image Hub as a related project (a sample application). Also, see Meshery's filter management capabitilies.

Weekly Meeting Details

See all community meeting details --> https://meet.layer5.io


Join the service mesh community!

Our projects are community-built and welcome collaboration. ๐Ÿ‘ Be sure to see the Layer5 Community Welcome Guide for a tour of resources available to you and jump into our Slack!

Layer5 Service Mesh Community

Layer5 Service Mesh Community

โœ”๏ธ Join community meetings. See details on the Layer5 community calendar.
โœ”๏ธ Watch community meeting recordings.
โœ”๏ธ Access the Community Drive by completing a community Member Form.
โœ”๏ธ Discuss in the Community Forum.

Not sure where to start? Grab an open issue with the help-wanted label.

ย 

About Layer5

Community First

The Layer5 community represents the largest collection of service mesh projects and their maintainers in the world.

Open Source First

Our projects establish industry standards and enable service developers, owners, and operators with repeatable patterns and best practices for managing all aspects of distributed services. Our shared commitment to the open source spirit push the Layer5 community and its projects forward.


Get the Rust toolchain

To compile Rust filters to WASM, the nightly toolchain and support for wasm compilation target is needed. Make sure you have Rust and Cargo installed using Rustup. If you're on a *nix system (Unix, Linux, MacOS), in the project root directory, run:

make rust-toolchain

This will also install wasm-pack for you. Also, take a look at installing wasm-pack for OS other than *nix.

Upstream

Upstream is a webserver which is used by few of the filters mentioned above. It provides a route for :

  • Mock authentication
  • Storing Metrics
  • Retrieving Metrics

Build the docker Image for Upstream before proceeding with the examples.

Build Image:

cd upstream
make

HTTP-Auth

Simulates handling authentication of requests at proxy level. Requests with a header token with value hello are accepted as authorized while the rest unauthorized. The actual authentication is handled by the Upstream server. Whenever the proxy recieves a request it extracts the token header and makes a request to the Upstream server which validates the token and returns a response.

Build and deploy:

cd http-auth
make run-filtered

Test:

curl  -H "token":"hello" 0.0.0.0:18000 -v # Authorized
curl  -H "token":"world" 0.0.0.0:18000 -v # Unauthorized

TCP-Metrics

Collects simple metrics for every TCP packet and logs it.

Build and deploy:

cd tcp-metrics
make run-filtered

Test:

curl 0.0.0.0:18000 -v -d "request body"

Check the logs for the metrics.

TCP-Packet-Parse

Parses the contents of every TCP packet the proxy receives and logs it.

Build and deploy:

cd tcp-packet-parse
make run-filtered

Test:

curl 0.0.0.0:18000 -v -d "request body"

Check the logs for the packet contents.

Singleton-HTTP-Call

An example which depicts an singleton HTTP WASM service which does an HTTP call once every 2 seconds.

Build and deploy:

cd singleton-http-call
make run-filtered

Check the logs for the response of the request.

Metrics-Store

This example showcases communication between a WASM filter and a service via shared queue. It combines the Singleton-HTTP-Call and TCP-Metrics examples. The filter collects metrics and enqueues it onto the queue while the service dequeues it and sends it to upstream server where it is stored.

Build and deploy:

cd metrics-store
make run-filtered

Test:

curl 0.0.0.0:18000 -v -d "request body" # make a few of these calls
curl 0.0.0.0:8080/retrieve -v # Retrieves the stored stats
# x | y | z  === x : downstream bytes, y : upstream bytes, z: the latency for application server to respond 

wasm-filters's People

Contributors

adeola-adesoba avatar adithyaakrishna avatar aminoxix avatar ashiscs avatar chetak123 avatar delusionaloptimist avatar josephmidura avatar kanishkarj avatar kumarabd avatar leecalcote avatar pranav-bhatt avatar shuklaritvik06 avatar subhamkrai avatar warunicorn19 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.