Socket
Book a DemoInstallSign in
Socket

@interopio/gateway-server

Package Overview
Dependencies
Maintainers
12
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@interopio/gateway-server

[![npm version](https://img.shields.io/npm/v/@interopio/gateway-server.svg)](https://www.npmjs.com/package/@interopio/gateway-server)

latest
Source
npmnpm
Version
0.14.1
Version published
Maintainers
12
Created
Source

io.Gateway Server

npm version

Overview

The @interopio/gateway-server package is the web server used to run the gateway as a standalone server app accessible via WebSocket.

Table of Contents

Getting Started

import GatewayServer, {type Server} from '@interopio/gateway-server';

const server: Server = await GatewayServer({
    port: 8385,
    gateway: {
        route: '/gw',
        access: 'authenticated'
    }
});

await server.close();

Configure HTTPS

import GatewayServer, {type Server} from '@interopio/gateway-server';

const server: Server = await GatewayServer({
    port: 8443,
    ssl: {
        cert: "glue42.crt",
        ca: "intermediate.crt",
        key: "glue42.key"
    },
    auth: {
        type: 'oauth2', // or 'basic'
        oauth2: {
            jwt: {
                issuer: 'https://auth.example.com',
                audience: 'https://api.example.com'
            }
        },
        basic: {
            username: 'interopio',
            password: 'passwordo'
        }
    },
    app: async ({handle}) => {
        handle(
            {
                request: {method: 'GET', path: '/api/metrics'},
                options: {cors: true, authorize: {access: 'authenticated'}},
                handler: async ({response}) => {
                    response.setStatusCode({value: 200}); // OK
                    await response.end();
                }
            },
            {
                request: {method: 'POST', path: '/api/metrics'},
                options: {cors: true, authorize: {access: 'authenticated'}},
                handler: async ({request, response}) => {
                    response.statusCode({value: 202}); // Accepted
                    await response.end();
                    try {
                        const update = await request.json();
                        console.log(`${JSON.stringify(update)}`);
                    } catch (e) {
                        console.error('Error processing metrics:', e);
                    }
                }
            });
    },
});

await server.close();

@glue42/gateway-ent Compatibility

This package aims to provide compatibility with @glue42/gateway-ent proprietary package used in Glue42 Desktop (now io.Connect Desktop)

import * as gw from '@interopio/gateway-server/gateway-ent';

Changelog

See changelog

License

Interop.io Developer License Agreement

Keywords

gateway

FAQs

Package last updated on 04 Nov 2025

Did you know?

Socket

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