Files
nats-server/server
Ivan Kozlovic 7c59ce3dba [ADDED] Reject clients connecting to route's listen port
This happens sometimes, and the latest occurence was today:
https://github.com/nats-io/java-nats/issues/96

When it happens, there is no error but subscribers would not receive
anything, etc...

This PR uses the fact that clients set the field Lang in the CONNECT
protocol that ROUTEs do not. I have checked that all Apcera supported
clients do set Lang in the CONNECT protocol.
If we plan to add Lang for routes, we need to find another field or
use a new one, in which case that would work only for new clients
(that would need to be updated).

With this change, when the server accepts a connection on the route
port and detects that this protocol field is present, it now closes
the client connection.

The nice thing is that newer clients, when incorrectly connecting
to the route port, get from the route's INFO the list of client URLs,
which means that on the initial connect error, they are able to
subsequently connect to the proper client port, so it is transparent
to the user (which may or may not be a good thing). However, it is not
guaranteed because if the client is not setting NoRandomize to true,
the client URL is added but the array shuffled, so it is possible that
the client library does not find the correct port in the connect loop.
2017-01-24 19:46:46 -07:00
..
2016-12-21 10:31:22 +01:00
2017-01-05 16:13:44 -07:00
2016-12-15 15:38:15 -07:00
2016-09-12 11:03:19 -04:00
2017-01-24 19:34:17 -07:00
2016-12-22 14:59:27 -07:00
2016-11-22 16:22:51 -07:00
2016-04-03 13:04:06 -07:00
2016-07-11 12:16:21 -07:00
2016-03-20 15:57:43 -10:00