IOTA MAM messaging with node.js server - node.js

-I'm using (https://github.com/xdk2mam/xdk2mam/tree/Workbench-3.6/http-sdcard).
-I'm not versed on JS so I'm not understanding the problem here.
-I'm trying to send a string of sensor data to the tangle and listen to it using a node.js server.
-I keep getting either ECONNREFUSED or ECONNRESET and Protocol not supported(but I think I get when this last one happens, but I don't really understand why.
-I'm trying to use comnet [I assumed it would be for such tasks]
-(https://comnet.tanglebay.com/)
-(https://api.lb-0.testnet.chrysalis2.com/)
-with port 15600
-I'm also trying to get my node up and running to test such things but still don't have enough peers to sync to(but the node is running).
-Correct me if I'm wrong but my understanding is:
-IOTA messaging(gossip) is free right?
-So why would any Node deny the connection?
-So the problem must be in the connection, but if that's the case the reason escapes me.
-Do I need some kind of authorization from the node for the message to go trough?
-Can anyone have a quick look and point me in the right direction? Any help would be appreciated.

I solved this error by opening the respective port on the firewall. Got me another error now.
connect ETIMEDOUT

I'm now using:
https://github.com/iot2tangle/XDK110-Bosch/tree/master/http-sdcard this is apparently working

Related

Why does every npm ip package give me 127.0.0.1 instead of 192.168.xx.xx?

Apologies for the simple question but I have been unable to figure out what is happening here. I am building a react.js app which accesses an express back end from a different port.
Right now I am using fetch to do so as such
fetch("http://192.168.0.126:9000/testAPI")
While it would be ideal to use localhost instead of the local ipv4, the purpose is to access from another device. I have been trying, and failing, to use different node packages, like local-ip-url, to concatenate into a string, and while that works, it only gives the 127.0.0.1 address, which does not work on another device on the network. Most basically, at the beginning of my App.js file I have these 2 lines of code
const localIpUrl = require('local-ip-url');
console.log(localIpUrl('public', 'ipv4'))
And out on the console comes 127.0.0.1, despite the 'public' being included. I am very stuck on this, and would appreciate any light on why this is happening.
Thanks heaps.
edit: just wanted to add that the ip is found using address.ip() in WebpackDevServerUtils.js, which react uses (from my understanding) to print the URL to the terminal after compiling. When I try this in my App.js, the variable is undefined, so I think I am doing something wrong

Why does my express.js app never loads?

I did everything as specified here:
https://expressjs.com/en/starter/hello-world.html
When I try to reach my domain, and append :3000 to the end, it just never loads (timeout).
If you did everything specified on https://expressjs.com/en/starter/hello-world.html and it didn't work then it must mean that the tutorial is incorrect.
If, on the other hand, you didn't do everything as specified in the tutorial (which we will never know since you didn't post what you actually did) then you should make sure to follow the tutorial more closely because it doesn't look incorrect.
The reasons why trying to reach a random domain on a random port times out can be:
wrong port
wrong domain
bad DNS record
misconfigured DNS resolver
firewall rules
server not listening
server listening on a different port
server listening on a different interface
Unfortunately you didn't provide enough information for a better answer, with that said the most likely issue is that you never actually executed the JavaScript file you created. You'll want to make sure Node is installed and run:
nodejs app.js
Keep in mind that in some distros node doesn't exist, but nodejs does, when installing node from a package manager or other installer.
EDIT
There are other potential issues you'd run into if you don't have port 3000 opened up if you're not running it on localhost.

How to access hosted Beanstalkd server

Beginner in Beanstalkd here. I have a hosted Beanstalkd server elsewhere with the following URL : http://beanstalkdhost:1234/here.
Questions:
- How would I be able to view the lists of tubes/jobs available? Note that this server is not hosted by me.
How do I put jobs into the tubes of this server, when specs says it requires a POST and custom headers for a request. The clients (in NodeJS) I have came across over the Internet at the moment, do not allow for custom headers, and also almost always requires a 'port number' parameter which messes up the whole URL. It will end up as 'http://beanstalkdhost:1234/here:1234'.
Do note that I am also running a Windows machine (I believe there might be some limitations).
Will appreciate if I can get some advice.
Thanks in advance!
Beanstalkd is not a webservice. It does not present as a web-URL, but as a TCP socket that a connection is opened to, and bytes are sent to.
Knowing who is running the server for you might help out a lot in assisting you, but it does not appear to be a standard Beanstalkd queue.

Socket.IO Connection Not working on University Wifi

I have created an chat app using Socket.IO . It works fine on my home internet. But whenever I am at my university and connected to versity wifi internet, I can't get connected at all. Its facing 'net::ERR_CONNECTION_TIMED_OUT' error.
Here is the url: demo.codesamplez.com/ultrachat/demo.html (You will may get it OK, as I do on home)
I guess, this might be some kind of firewall issue or something?
Does anybody has any clue how to go forward for solving this? Thanks in advance.
Switching from HTTP to HTTPS should get around the problem with incompatible proxy server. That forces the proxy to use HTTP tunneling to maintain the connection instead performing whatever magic it does.

XMPPHP Could not connect after timeout

I am trying to create a web based PHP application which can allow chat to my Gmail friends. Something like meebo.com. I downloaded XMPPHP, and executed on localhost, and it is working fine, but when I uploaded everything to Yahoo Small business web hosting, it is throwing connection timeout error.
Do anyone else faced such problem. I heard many of them did, but no one have any solution yet.
Any suggestion will be very helpful. I am new to XMPP clients.
Just some ideas...
How are you trying to connect to the XMPP server? With XMPPHP you may use two classes which are
XMPPHP
XMPPHP_BOSH
You might try both, since they work on different ports (XMPPHP for example on 5222 and XMPPHP_BOSH on 80). So if this is a port issue, trying XMPPHP_BOSH would be an idea. You will need to find out though if this is supported by the XMPP server you are trying to connect to. And if so, you need to know the url the server exposes the BOSH service on.
Anyways, I would recommend to check out what kind of 'restrictions' there are in Yahoo Small business web hosting and on the side of the XMPP server.
If you intend to check XMPPHP_BOSH out, consider this issue to make it work: Issue 47: Http-bind error. All in all XMPPHP seems very buggy and incomplete...

Resources