TooTallNate / Java-WebSocket

A barebones WebSocket client and server implementation written in 100% Java.
http://tootallnate.github.io/Java-WebSocket
MIT License
10.47k stars 2.57k forks source link

Support Status Code in HTTP Response for WebSocket Handshake #1424

Open jjm159 opened 3 months ago

jjm159 commented 3 months ago

Description

I modified generateHttpResponseDueToError to accept errorCode and errorMessage, allowing the library user to determine the message included in the HTTP response status line.

Related Issue

1423

How Has This Been Tested?

I implemented onWebsocketHandshakeReceivedAsServer and induced an error during the socket connection. I confirmed that the desired status code and message were added to the response status line.

Types of changes

Checklist: