ejabberd component port - components

may i know if i want to use component to connect to ejabberd, do i connect to port 5222 or do i need to create new port? any guide on how to create it?

Each component has to use a different port. You can set that up in the ejabberd config.
The setup happens with the listen block. For example :
{5237, ejabberd_service, [{hosts, ["gg.example.org"],
[{password, "ggsecret"}]}]},
Good luck!

Related

Which is best port to use for secure Chat server to allow general firewall bypass (port 443 is already occupied)

so I developed a public chat application which will run on a node server using secure socket.io.
That server, which only has a single IP address already has ports 80 / 443 occupied.
So I need to find the next best port to use for the chat server.
I wonder is there a recommended next best port that will allow most firwalls to communicate to? I know for example using ports like 21 (FTP) will normally be blocked.
And is it best to pick one above 1024 or below?
thanks
Sean.
In general 8443 will be the "alternative port for HTTPS", but you are still at risk of being filtered.
The proper solution should be to run proxy like nginx on port 443 and provide access to various applications based on the hostname, not the port. In example you can configure it to run your current app when user reaches https://example.com and chat app when user reaches https://chat.example.com.
Here is an example article showing how to do it https://www.manuelkruisz.com/blog/posts/nginx-multiple-domains-one-server
The idea is that each app runs on different internal port on the server, and proxy running on port 443 picks which app the request should be routed to based on the hostname.

TCP server won't work on Openshift NodeJS

I've used the openshift-cartridge-tcp-endpoint cartridge to try and make a TCP server which I can access from a desktop application.
I've set it up on a scaleable application and I can see the OPENSHIFT_NODEJS_PORT_TCP and OPENSHIFT_NODEJS_PROXY_PORT_TCP values when I list the environment variables using 'export' when ssh'd into my application.
The problem is, when I do 'rhc ssh APP_NAME oo-gear-registry all', no port is listed over which I can access my TCP application and when I try to access the application over the port given by the HTTP server, it does not connect. Do I have to take additional steps to make the port show up and be accessible?
It looks like that cartridge is over 2 years old, and probably doesn't work with the current version of OpenShift Online, as it only exposes port 8080 publicly and uses an HTTP/WS reverse proxy, so only http or web services connections would work. You might try logging an issue with the cartridge's creator here (https://github.com/Filirom1/openshift-cartridge-tcp-endpoint/issues) and ask them if it still works or not.

Socket server with Node.js and Cloud9 IDE

I am totally new to Cloud9 IDE, so my question amy be silly, but i can't find answer in docs. I want to make client - server application with Node.js + MongoDB as socket server, and client - desktop application which I debug and run on my machine (Cloud9 IDE doesn't support language on which I write it). Looking at Cloud9 IDE I've found it very nice for developing server-side part of my application and may be as hosting solution. But I can't find how to make socket connection from client. For this I need to know IP adress or domain address of my server (I suppose it looks like "https://socialcrm-c9-painkkkiller.c9.io") and port number.
In docs I've found about "use process.env.PORT as the port and process.env.IP as the host in your scripts!" but to connect to server I need they real values! Commands
console.log(process.env.PORT) and console.log(process.env.IP) gives me just "8080" and 0.0.0.0
Using "https://socialcrm-c9-painkkkiller.c9.io" as domain and 8080 as port gives me socket error. So is it possible at all? And if possible how to do it?
Cloud9 forwards port 80 of https://socialcrm-c9-painkkkiller.c9.io to port 8080 in your container. So there is no need to specify the port.
We do also support web sockets and they work in the same way. There's no need to specify another port.
The only thing you need to do is to make sure you are using the environment variables to connect to the right $IP and $PORT when starting your back-end process.
Old question - but I'm struggling with a similar problem. I don't have reputation to add a comment, but this should answer your question about getting the IP into your Cloud9 application.
You can reference process.env.IPto grab the IP... and fwiw, you can reference process.env.PORT to get the port.
Taken from:
https://community.c9.io/t/writing-a-node-js-app/1731

How to set up Node server for production on own machine?

This must be a pretty basic thing to do, but I cannot find any good guide on how to do it on the internet. I only find how to set up a development environment for Node. I want to be able to forward my R-Pi's port 80 to my Node server, which I want to obviously listen on port 80. How can I close the native port 80 so that I can let me Node server listen on that port.
Ultimately, I want to be able to access my pi from any remote location. I know how to set up a static IP and forward the port on my router, but now how do I allow Node into port 80?
Two options. Either disable any other service running on port 80 and run Node with sudo. Or setup something like nginx to forward traffic from port 80 to your Node instance. To do that you can open a socket file with node and configure nginx similar to https://github.com/trevnorris/norrd/blob/master/conf/nginx.conf
Creating the socket is simple enough. It's as simple as
net.createServer(function(){}).listen('/path/to/file.sock');
I usually opt to spawn child processes for easier monitoring from the parent process, but use nginx to connect to each socket. For two reasons, one is it's easy to set route static content around the node process, and also because I prefer not to setup my own access privileges from scratch.

Node.js - Forbid declaration of specific TCP port and use a variable instead (a la Cloud9)

I'm sharing a server to develop Node.js apps with others and I want to forbid the declaration of a specific port and instead use a var/function to assign an unused port from a pool.
I'm aware that Cloud9 implements this functionality as they force the use of a variable to set up the port (e.g. When specifically declaring the port, it replies with "Error: Port not allowed, please use 'process.env.C9_PORT' as port and '0.0.0.0' as host."), however, I don't want to install Cloud9 and even if I wanted to, it doesn't works as it does on their website, also, it allows the use of a specific port.
What can I do to force the use of a var instead of the declaration of specific ports? Is there a Node.js module already doing this? Can anyone please try to help me in this?
Thank you all in advance!
Yes, there is a node.js module that does this - portfinder

Resources