Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not working using express 4.16.1 #131

Open
reashetyrr opened this issue Mar 13, 2020 · 2 comments
Open

not working using express 4.16.1 #131

reashetyrr opened this issue Mar 13, 2020 · 2 comments

Comments

@reashetyrr
Copy link

reashetyrr commented Mar 13, 2020

Hi,

ive tried to make the express-ws work with express 4.16.1

im using packages:
"cookie-parser": "~1.4.4",
"debug": "~2.6.9",
"express": "~4.16.1",
"express-session": "^1.17.0",
"express-ws": "^4.0.0",
"glob": "^7.1.6",
"morgan": "~1.9.1",
"mysql": "^2.18.1",
"nunjucks": "^3.2.0",
"webdav": "^3.2.0"

the code ive tried is:

app.ws('/socket/media_files', function (ws, req) {
    ws.on('message', async msg => {
        const file_object = JSON.parse(msg);
        ws.send(`data:${file_object.mime};base64,${await client.getFileContents(file_object.filename, {format: 'text'})}`);
    })
});
app.ws('/socket', function(ws, req) {
    ws.on('message', function(msg) {
        ws.send(msg);
    });
});```

ive also tried using the router but that also fails missirably, the issue i have is that i always get a 200 status request back 
@maruneko0
Copy link

Hi reashetyrr.

I had the same trouble.
Try the links below.
https://stackoverflow.com/questions/40362258/package-express-ws-doesnt-let-clients-connect

@xtianus79
Copy link

@maruneko0 want to elaborate on this? like explain what it's doing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants