Skip to content

await cycleTls.ws() never resolves and if is responseType: 'stream' is not possible to .send() #408

@ForgeOfficial

Description

@ForgeOfficial

Description

import initCycleTLS from "cycletls";

(async () => {
    const cycleTls = await initCycleTLS();
    const wsResponse = await cycleTls.ws('wss://echo.websocket.org', {
        ja3: '771,4865-4867-4866-49195-49199-52393-52392-49196-49200-49162-49161-49171-49172-51-57-47-53-10,0-23-65281-10-11-35-16-5-51-43-13-45-28-21,29-23-24-25-256-257,0',
        userAgent: 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:87.0) Gecko/20100101 Firefox/87.0',
        headers: {
            'Sec-WebSocket-Protocol': 'echo-protocol'
        }
    });

    if (wsResponse.status === 101) {
        console.log('WebSocket upgrade successful');
        console.log('Response headers:', wsResponse.headers);
    }
})();

Hello, i test cycleTls for Websocket received and send but actually is not working.
The promise gets stuck at await cycleTls.ws, which makes it impossible to use events or send data.
The only workaround is to add responseType: 'stream', but that makes it read-only, so sending data isn’t possible.

Do you have a solution?

Issue Type

Bug

Operating System

Windows 10

Node Version

Node 22.x

Golang Version

None

Relevant Log Output

Metadata

Metadata

Assignees

Labels

triageThis ticket will be looked at shortly

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions