"Error: bind EAFNOSUPPORT" when trying to use udp6 - node.js

I have a script running smoothly on one server
// create a new UDP server
dgram = require('dgram');
server = dgram.createSocket('udp6');
server.bind(20500,config.server.ip);
on the second server executing the code throws an error: "Error: bind EAFNOSUPPORT"
node version is v0.10.26 on both machines, however the one where it is working is Ubuntu 12.04.4 LTS (GNU/Linux 3.2.0-56-virtual x86_64) and the one where it is not working is Ubuntu 12.04.4 LTS (GNU/Linux 2.6.32-312-ec2 x86_64)
so the Kernel versions are quite different. What could possible be a fix to for this error?

I solved this issue by changing to
server = dgram.createSocket('udp4');
and setting my server ip to 0.0.0.0
I was not able to make udp6 work

Related

psql - Mac trying to connect postgreSQL in Ubuntu system installed in a virtual machine in remote server

Apologize in front, maybe the situation here is a bit complicated. I searched everywhere online but couldn't find a perfect solution, plus I have tried almost all the solutions mentioned in other posts.
Situation:
So I have a postgreSQL database installed in a Ubuntu system. The system is actually a virtual machine on the VMware workstation 12, which is installed on Windows 7 professional. Now I am trying to remotely access the postgreSQL database through my MacBook pro 2013.
In the Mac terminal, the command line I tried is:
psql -U postgres -h xxx.xxx.xxx.xx
"xxx.xxx.xxx.xx" represents the IP address of the Windows 7 machine. The result is a failure:
psql: could not connect to server: Operation timed out
Is the server running on host "169.254.121.2" and accepting
TCP/IP connections on port 5432?
What I have done:
Edited the pg_hba.conf file to include
host all all 0.0.0.0/0 md5
Edited the postgresql.conf to include
listen_addresses='*'
Restarted postgres service.
Disabled firewall on the host.
I checked by running the psql command locally and it worked. Also, on the same VMware I have other Ubuntu systems. They are all fine to connect and access the data in this Ubuntu system.
Running Nmap, the output is
PORT STATE SERVICE
5432/TCP open postgresql
What's next? Anything else I can try? Any advice is highly appreciated and please let me know if anything above is ambiguous. I will clarify for better diagnosis. Thank you all!
Somehow managed to get it working..
So when I ran "Nmap" on the other Ubuntu system towards this one, it does shows
PORT STATE SERVICE
5432/TCP open postgresql
However, when I ran "Nmap" on my Mac, it's a different port, 3389, which is mainly used for Windows remote desktop. So what I did was to check the network configuration of this Ubuntu virtual machine from "bridged" to "NAT" and did a port forwarding to 5432. It is working fine now..
I read in some places saying that VMware favors bridged whereas VirtualBox favors NAT+port forwarding. I am quite confused as it is certain not the case in my situation. Maybe I am wrong.

Run NodeJs on port 80

I am trying to host my app on port 80. I know that it is a root port. I tried running my app with sudo, but no luck. P.S I am using Linux 16.04 LTS server. Thx!

AWS Ubuntu 13.04 and Websockets

I have launched an instance (Ubuntu Server 13.04 - ami-c30360aa (64-bit)) and I cannot get websockets working over port 80.
They work on other ports, such as 50000 or whatever I want -- however on port 80 I always receive:
"' failed: Unexpected response code: 400 "
Does anybody have any solutions? I had them working on port 80 via Linux AMI on AWS, and on an older version of Ubuntu.

Specify host parameter for Node.js on Amazon EC2

Most of my node apps I have been able to start like this:
server.listen(8080);
Now I am working with a phantomJS script which requires you to pass the host and port when starting the server. I have not been able to even get a simple hello world to work. I have tried to get the host value several different ways:
from a app.js file
var hostname = require(‘os’).hostname().split(‘.’).shift();
from commandline
uname -n
hostname
And starting the server like this:
server.listen(8080,"127.0.0.1");
server.listen(8080,"localhost");
...etc
And the server starts w/o errors, but never responds to http requests. When I remove the host parameter it works fine.
node -v
v0.10.10
Distributor ID: Ubuntu
Description: Ubuntu 10.04.4 LTS
Release: 10.04
Codename: lucid
running in an ec2 instance
Any thoughts?
I'm not sure why this works as the host
0.0.0.0
If someone can shed some light I'll be sure to mark as answered, thanks for reading.

How to connect redis-cli on Windows to redis on Linux (on VMware)

I have Windows 8 as a host and Linux guest on VMware and installed redis on Linux, redis works correctly.
I don't know how to connect a redis-cli -h [ipAddress] to redis on Linux with VMware.
How to config network on Linux, Windows 8 and VMware ?
I don't know which [ipAddress] to use to connect redis on Linux with VMware?
[update]
I have ping from windows and I can connect redis-cli on Linux (on
VMware) to redis-server on Windows.
I use Install Redis
I had a similar situation with Redis running on Ubuntu 12 on VirtualBox and then running Windows 7 as the host. I was having trouble connecting from Windows 7 to the Ubuntu machine.
I had to edit my redis.conf (/etc/redis/redis.conf on Ubuntu) file and comment out this line:
#bind 127.0.0.1
Worked for me.
Sounds like a networking/firewall issue. You should connect to the redis server through redis-cli the same way no matter what operating system the server and client are on. This should always be redis-cli -h [ipAddress].

Resources