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

unique-transport

v1.0.141

Published

This plugin is designed to deliver a message from Alice to Bob at any cost.

Downloads

14

Readme

Unique Transport

npm version Code Climate Test Coverage Issue Count Donate

This plugin is designed to deliver a message from Alice to Bob at any cost.

Description

The basic idea of the script is that there are two devices (client Alice and the server Bob). Alice needs to send a message to Bob and get his data. While there is a third party that monitors the traffic between Alice and Bob and does some queries.

Thus to send the message using multiple channels:

  • xhr support http methods GET, POST, PUT, PATH and data transfer path, file name, parameters, headers and request body.
  • fetch - support http methods GET, POST, PUT, PATH and data transfer path, file name, parameters, headers and request body.
  • iframe - data communication path, the file name and parameters.
  • script - data communication path, the file name and parameters.
  • image - data communication path, the file name and parameters.
  • style - with data transfer in the path, the file name and parameters.

Channel transmission method and transmission parts data are selected randomly. Data requests are performed until.

Build

The repository contains pre-compiled files, but if you want to add your files and compile, then run the following commands in the repository folder.

  • npm install
  • npm run production

or

  • npm run development

The build required NodeJs version 6 or higher.

Usage

For details, see /src/ts/**.

Client

import ClientClass from "../../lib/ts/client";

const Client = new ClientClass();

Client.emit().then(
    (result) => {
        console.log(result);
    }
);

Server

import ServerClass from "../../lib/ts/server";

const Server = new ServerClass();

// Listened event name and callback
Server.on("connect", (data) => {
    return "OK";
});

Settings

Client

Main settings

{
    ServerAddress: "http://127.0.0.1:8888/", // Default connection address
    ConnectionTimeout: 1000, // Connection timeout
    Password: "xmas", // Password
    Reconnections: 10, // Default reconnection
    Transports: { // Transports: If some settings of the transport or the whole transport is not needed, then it should be set to false go is to remove from the settings.
        xhr: {
            HttpMethods: {
                GET: true,
                POST: true,
                PUT: true,
                PATCH: true,
            },
            SubTransports: {
                path: true,
                name: true,
                params: true,
                header: true,
                body: true,
            },
        },
        fetch: {
            HttpMethods: {
                GET: true,
                POST: true,
                PUT: true,
                PATCH: true,
            },
            SubTransports: {
                path: true,
                name: true,
                params: true,
                header: true,
                body: true,
            },
        },
        iframe: {
            SubTransports: {
                path: true,
                name: true,
                params: true,
            },
        },
        script: {
            SubTransports: {
                path: true,
                name: true,
                params: true,
            },
        },
        image: {
            SubTransports: {
                path: true,
                name: true,
                params: true,
            },
        },
        style: {
            SubTransports: {
                path: true,
                name: true,
                params: true,
            },
        }
    },
}

Emit settings

{
    Event: "connect", // Event name [required]
    Data: {}, // Data [optional]
    Url: "http://127.0.0.1:8888/test/", // Connection url [optional]
    Reconnections: 10, // Max reconnections [optional]
}

Server

Main settings

{
    ServerPort: 8888, // Port to listen on
    ConnectionTimeout: 1000, // Connection timeout
    Password: "xmas", // Password
    SuccessResponseCode: 200, // Success http response code
    ErrorResponseCode: 404, // Error http response code
}