Skip to content

Commit

Permalink
Add websockets as transport by default
Browse files Browse the repository at this point in the history
  • Loading branch information
mkg20001 committed Sep 10, 2017
1 parent 0d97bb0 commit c818983
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 14 deletions.
8 changes: 5 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

const Bundler = require("./bundle")
const TCP = require('libp2p-tcp')
const WS = require("libp2p-websockets")
module.exports = Bundler({
name: "ZeroNetNodeJSBundle",
modules: {
Expand Down Expand Up @@ -31,9 +32,10 @@ module.exports = Bundler({
libp2p: {
listen: [],
transports: [
new TCP()
]/*,
mdns: false,
new TCP(),
new WS()
],
mdns: true/*,
dht: false*/
}
}
Expand Down
93 changes: 85 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"dependencies": {
"colors": "^1.1.2",
"libp2p-tcp": "^0.11.0",
"libp2p-websockets": "^0.10.1",
"merge-recursive": "0.0.3",
"mkdirp": "^0.5.1",
"mockery": "^2.1.0",
Expand Down
10 changes: 7 additions & 3 deletions zeronet.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ mkdirp.sync(path.join(dir, "logs"))
let cm

const TCP = require('libp2p-tcp')
const WS = require("libp2p-websockets")

const defaults = {
id_expire: 1000 * 60 * 60 * 24 * 7, //approx 1 week
Expand All @@ -39,7 +40,8 @@ const defaults = {
"/ip4/0.0.0.0/tcp/15543"
],
transports: [
new TCP()
new TCP(),
new WS()
],
trackers: [
//"zero://boot3rdez4rzn36x.onion:15441",
Expand All @@ -61,8 +63,10 @@ const defaults = {
libp2p: {
listen: [
"/ip4/0.0.0.0/tcp/15542",
"/ip6/::1/tcp/15542",
"/p2p-websocket-star"
"/ip6/::/tcp/15542",
"/p2p-websocket-star",
"/ip4/0.0.0.0/tcp/15541/ws",
"/ip6/::/tcp/15541/ws"
],
transports: [
new TCP()
Expand Down

0 comments on commit c818983

Please sign in to comment.