NATS client cannot connect to polygon

I no longer can use Quantconnect to trade on Alpaca, there is an error connecting to polygon via NATS client. I tried everything I could think of with no luck. It’s the case in both paper and live trading.

I tried writing a basic NATS client and see if I could successfully connect to polygon, and unfortunately it wasn’t the case. Here’s the error my nodejs client produced:

name: ‘NatsError’,
message: 'Could not connect to server: Error: connect ETIMEDOUT []
code: ‘CONN_ERR’,
chainedError: Error: connect ETIMEDOUT
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1137:16) {
errno: -110,
code: ‘ETIMEDOUT’,
syscall: ‘connect’,
address: ‘’,
port: 31103

I believe it’s either polygon is blocking my connection or there is some weird reason behind it. I would appreciate any help.


I cannot connect to their ips either, so I’ve been using polygon rest api and websocket streams instead but I see there is a delay there, the trades showing and quotes are delayed in time…

Yeah, I found out their support of NATS were deprecated by the beginning of the 2020 :frowning:
Now the folks at Quantconnect are gonna try to replace their NATS client with a websocket client

You can rewrite the python code to use the socket as well, are you seeing delay on the socket as well?