org.apache.tomcat.websocket.Util.getCloseCode() converts codes between 3000 and 4999 to 1000. This behaviour is non-standard and differs from the behaviour of javax.websocket.CloseReason$CloseCodes which returns the correct close codes. return new CloseReason.CloseCode() { @Override public int getCode() { return code; } };
Thanks for the report. This has been fixed in trunk, 8.0.x (for 8.0.25 onwards) and 7.0x. (for 7.0.64 onwards).