bitchan / bitmessage-transports Goto Github PK
View Code? Open in Web Editor NEWbitmessage transports
License: Creative Commons Zero v1.0 Universal
bitmessage transports
License: Creative Commons Zero v1.0 Universal
After connection was established, transports should send pong packets every 5 minutes to avoid connection timeout (10 minutes) if remote node is idle.
When I'm running the networking example code below it does not establishing a connection.
var messages = require("bitmessage").messages;
var TcpTransport = require("bitmessage-transports").TcpTransport;
var tcp = new TcpTransport({
dnsSeeds: [["bootstrap8444.bitmessage.org", 8444]],
});
tcp.bootstrap().then(function(nodes) {
var remoteHost = nodes[0][0];
var remotePort = nodes[0][1];
console.log("Connecting to", nodes[0]);
tcp.connect(remotePort, remoteHost);
});
tcp.on("established", function(version) {
console.log("Connection established to", version.userAgent);
tcp.on("message", function(command, payload) {
console.log("Got new", command, "message");
var decoded;
if (command === "addr") {
decoded = messages.addr.decodePayload(payload);
console.log("Got", decoded.addrs.length, "node addresses");
}
});
});
An initial syn package is sent followed by 6 re-transmissions and than it just sits until it crashes with the output below.
node test_code.js
Connecting to [ '118.169.41.196', 8444 ]
events.js:85
throw er; // Unhandled 'error' event
^
Error: connect ETIMEDOUT
at exports._errnoException (util.js:746:11)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1010:19)
Everything is fine if I'm running the tests for the library, no problem with establishing a tcp connection with localhost. Do you have any idea of why it's not working?
Many thanks.
It would be good to have WebRTC transport as well. Browsers (Firefox, Chrome) have native implementations, package for node: wrtc.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.