How to carry cookies when a WebSocket connection

I would like to inquire about how to include cookies during the establishment of a WebSocket connection.

UXP to send requests. While HTTP requests can carry cookies, WebSocket requests cannot.

{
  connection: 'Upgrade',
  host: 'localhost:3000',
  origin: 'file://',
  'sec-websocket-key': 'XJAZunGxNa6hbf4RvpQAkg==',
  'sec-websocket-version': '13',
  upgrade: 'websocket',
  'user-agent': 'WebSocket++/0.8.2'
}