diff --git a/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/CloseWebSocketFrame.java b/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/CloseWebSocketFrame.java
--- a/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/CloseWebSocketFrame.java
+++ b/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/CloseWebSocketFrame.java
@@ -135,7 +135,7 @@ public int statusCode() {
             return -1;
         }
 
-        return binaryData.getShort(binaryData.readerIndex());
+        return binaryData.getUnsignedShort(binaryData.readerIndex());
     }
 
     /**

diff --git a/codec-http/src/test/java/io/netty/handler/codec/http/websocketx/CloseWebSocketFrameTest.java b/codec-http/src/test/java/io/netty/handler/codec/http/websocketx/CloseWebSocketFrameTest.java
--- a/codec-http/src/test/java/io/netty/handler/codec/http/websocketx/CloseWebSocketFrameTest.java
+++ b/codec-http/src/test/java/io/netty/handler/codec/http/websocketx/CloseWebSocketFrameTest.java
@@ -80,6 +80,15 @@ void testNonZeroReaderIndex() {
                 WebSocketCloseStatus.NORMAL_CLOSURE.code(), WebSocketCloseStatus.NORMAL_CLOSURE.reasonText());
     }
 
+    @Test
+    void testCustomCloseCode() {
+        ByteBuf buffer = Unpooled.buffer().writeZero(1);
+        buffer.writeShort(60000)
+                .writeCharSequence("Custom close code", CharsetUtil.US_ASCII);
+        doTestValidCode(new CloseWebSocketFrame(true, 0, buffer.skipBytes(1)),
+                60000, "Custom close code");
+    }
+
     private static void doTestInvalidCode(ThrowableAssert.ThrowingCallable callable) {
         assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy(callable);
     }

CloseWebSocketFrame statusCode() get unexpected results
Set the  CloseWebSocketFrame code to 60000, and the result obtained by statusCode() is negative;

The WebSocket protocol states that Code is  a 2-byte unsigned integer (in network byte order)，But netty acquisition is obtained by signs.
![image](https://user-images.githubusercontent.com/11245691/211527112-5c0f2923-c6ba-4d29-9d4b-da5b228dcbdd.png)

![image](https://user-images.githubusercontent.com/11245691/211527879-19400bf7-f95c-4394-8301-8e3567245e63.png)

Here, getShort should be changed to getUnsignedShort.

Minimal yet complete reproducer code (or URL to code)
Netty version
4.1.80

JVM version (e.g. java -version)
openjdk 1.8.0_272

OS version (e.g. uname -a)
linux 4.19.36 aarch64

@zhangjinying can you do a PR with the change and a test ? 
> @zhangjinying can you do a PR with the change and a test ?

👌
org.io.netty.handler.codec.http.websocketx.CloseWebSocketFrameTest