I am building a service that requires clients to connect to it via a TCP port. It will be accessible over the Internet at some known port (say 9999). So, the clients would need to open a TCP connection to "myhost.com:9999".
Specifically, the service is targeted at web servers, including people running their apps on things like Heroku. My question is: How common is it for servers/hosts/providers to block outbound TCP connections?
I've seen this sometimes on AWS, but they tend to be super-restrictive with their VPC setups and so forth. I've never really seen it commonly done anywhere else, but my experience is pretty limited here. Does Heroku block outbound TCP connections? What about Azure cloud?
In short, if my service requires people to connect to my server via TCP at a specific port, how much of the world am I cutting out of my potential user pool?
Note: Before it's brought up, I'm planning on securing the TCP connection with SSL/TLS. I'm still a bit foggy on the details, but that part of the security puzzle is planned.
More Detail
I have a central server (S) and end users install a middleware layer that is the client (MW). MW will open a connection to S and periodically send/receive on it.
Clients don't need to implement or understand the protocol, they just install MW (a Rubygem in Ruby, npm package in Node, etc.) and provide a few config options. MW handles understanding the protocol and communicating.
Right now it's all handled with REST polling. It works, but seems kind of messy and unnecessarily verbose. S is written in Elixir, meaning it can theoretically handle a high number of open, idle connections. So, it seems like a good idea to use something other than REST polling.
Another choice here would be websockets, where MW connects to S via a websocket. Maybe that's the best choice practically, but it seems a bit strange to me that we're in a world where everything happens over port 80/443. Plus, I'm not sure how common it is to use websockets for server-to-server communication. They seem more oriented toward serving content to connected JavaScript clients.
Ultimately, my current REST polling solution works and will scale to a very high degree, way higher than I'll ever actually reach. I'm just curious about what it would take to "do it right".