Coder Social home page Coder Social logo

js-psychokinesis's Introduction

js-psychokinesis

Build Status Coverage Status npm version Downloads

去中心化的 HTTP 服务器,基于 DHT 、 HTTP/2 。

特性

  • P2P 节点间功能相同,地位相等
  • 支持 NAT 内网节点也可建立对外的 HTTP 服务

优势

  • 完全分散的数据。传统 C/S 架构需要将数据放置于 Server 端存储, 数据的控制权最终在于少数的 Server 节点,而 Psychokinesis 网络中数据完全存储于本地,不存在特权节点。
  • 极易扩展。Psychokinesis 网络中所有节点均有完全的功能,任一节点都可作为网络的入口。

快速开始

  1. npm install psychokinesis -g
  2. 启动一个独立的节点:psychokinesis test.psy -d 8181 -p 18181 -l 127.0.0.1

更多用法可查看帮助:psychokinesis --help

安装

  1. Node.js:版本 >= v5.3.0
  2. npm install psychokinesis

示例

'use strict';

var psychokinesis = require('psychokinesis');

let server = psychokinesis.createServer({
    domain: 'publicnode.com'
}, (req, resp) => {
    resp.end('hello world');
});

server.on('ready', () => {
    server.listen('127.0.0.1', 8181, () => {
        console.log('Node up!');
    });
});

完成后即可使用浏览器访问 http://127.0.0.1:8181/publicnode.com/

更多示例可查看 examples 目录。

Docker

打包

$ docker build -t covertness/psychokinesis .

js-psychokinesis's People

Contributors

covertness avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.