Socket
Socket
Sign inDemoInstall

microgateway-plugins

Package Overview
Dependencies
165
Maintainers
5
Versions
84
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    microgateway-plugins

Plugins for Apige Edge Microgateway


Version published
Weekly downloads
399
increased by216.67%
Maintainers
5
Created
Weekly downloads
 

Readme

Source

Plugins

Overview

This repo contains plugins for the microgateway-core project.

These plugins can be loaded into the microgateway calling the load plugin method

Building a plugin

must contain an init method which returns an object literal with all of the handlers

{
  init:function(config,logger,stats){
    return {
    onrequest:function(req,res,[options],next){
    },
    ...
    }
  }
}

init method must return an object with handler methods for each event

the available handlers are

  • on_request
  • ondata_request
  • onend_request
  • on_response
  • ondata_response
  • onend_response
  • onclose_response
  • onerror_response

The handler signature will look like :

function(sourceRequest,sourceResponse,[options],next){}
  • sourceRequest: the request from the northbound server;

  • sourceResponse the response to the northbound server;

  • options: are the full scope of fields you might need to operate on.

    	const options = {
        targetResponse: options.targetResponse,
        targetRequest: options.targetRequest,
        sourceRequest: options.sourceRequest,
        sourceResponse: options.sourceResponse,
        data: data
      };
    
  • you must call next with an error if you errored out like

next([err])

FAQs

Last updated on 25 Apr 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc