0.1.0 • Published 11 months ago

@ubiquify/relay v0.1.0

Weekly downloads
-
License
(Apache-2.0 AND M...
Repository
github
Last release
11 months ago

@ubiquify/relay

Relay for Ubiquify applications. Forked from O7-R.

Usage

As library.

import { BlockStore, memoryBlockStoreFactory } from "@ubiquify/core";
import {
  LinkResolver,
  memoryBlockResolverFactory,
  getCertificate,
  createGraphRelay,
} from "@ubiquify/relay";

const blockStore: BlockStore = memoryBlockStoreFactory();
const linkResolver: LinkResolver = memoryBlockResolverFactory();
const httpsPort = 3003;
const graphRelay = createGraphRelay(blockStore, linkResolver);
graphRelay.startHttps(3000, getCertificate(), () => {
  console.log(`GraphRelay listening on https://localhost:${httpsPort}`);
});
const httpPort = 3001;
graphRelay.startHttp(httpPort, () => {
  console.log(`GraphRelay listening on http://localhost:${httpPort}`);
});

Standalone.

npm start

SSL

The relay expects two files in the ssl folder:

  • server.key - Private key.
  • server.crt - Certificate.

A self signed certificate can be generated in linux with openssl:

cd ssl/
openssl req -nodes -new -x509 -keyout server.key -out server.crt

Build

npm run clean
npm install
npm run build
npm run test

Licenses

Licensed under either Apache 2.0 or MIT at your option.

0.1.0

11 months ago

0.0.15

2 years ago

0.0.14

2 years ago

0.0.13

2 years ago

0.0.12

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago