micahstubbs / lightpay

Atomic swaps for the Lightning Payment Network
https://lightpay.it/
MIT License
17 stars 2 forks source link

setup c4yt bcoin with bugfixes and neutrino support all at once #14

Closed micahstubbs closed 6 years ago

micahstubbs commented 6 years ago
screen shot 2018-04-08 at 2 22 27 pm
micahstubbs commented 6 years ago
micahstubbs commented 6 years ago

here is are our new ports

'use strict';

const bweb = require('bweb');
const fs = require('bfile');
const WSProxy = require('./wsproxy');

const index = fs.readFileSync(`${__dirname}/index.html`);
const app = fs.readFileSync(`${__dirname}/app.js`);
const worker = fs.readFileSync(`${__dirname}/worker.js`);

const proxy = new WSProxy({
  ports: [8334, 18334, 18445, 28334, 28902]
});

const server = bweb.server({
  port: Number(process.argv[2]) || 8081,
  sockets: false
});

server.use(server.router());

proxy.on('error', (err) => {
  console.error(err.stack);
});

server.on('error', (err) => {
  console.error(err.stack);
});

server.get('/', (req, res) => {
  res.send(200, index, 'html');
});

server.get('/app.js', (req, res) => {
  res.send(200, app, 'js');
});

server.get('/worker.js', (req, res) => {
  res.send(200, worker, 'js');
});

proxy.attach(server.http);

server.open();
micahstubbs commented 6 years ago

so to start, we use this command

micahstubbs commented 6 years ago

actually a duplicate of #4