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

Force websocket #62

Closed
quenti77 opened this issue May 22, 2017 · 7 comments
Closed

Force websocket #62

quenti77 opened this issue May 22, 2017 · 7 comments

Comments

@quenti77
Copy link

quenti77 commented May 22, 2017

How force to use websocket ?

On the server node with socket.io :

import * as socket from 'socket.io'
const port = 1337
const io = socket(port, {
  transports: ['websocket']
})

In my app electron-vue i have this error :

http://localhost:4100/socket.io/?EIO=3&transport=polling&t=Lmnk47U 400 (Bad Request)

Sry for my english

@felixheck
Copy link

same here

@codeofsumit
Copy link
Contributor

codeofsumit commented Jun 19, 2017

yup, need that as well. The options are missing on the client

@codeofsumit
Copy link
Contributor

codeofsumit commented Jun 19, 2017

as a temporary workaround you can require the library that is used internally and create your own socket instance that you pass to Vue-Socket.io

import io from 'socket.io-client';
import VueSocketio from 'vue-socket.io';

const socketInstance = io('http://localhost:3333', {
  transports: ['websocket'],
});

Vue.use(VueSocketio, socketInstance, store);

@felixheck
Copy link

Hi @MetinSeylan, would you mind sharing the reasons for closing this issue?
Is there a new related release?

@itoonx
Copy link

itoonx commented Jan 27, 2019

Not working with the lastest version

@MetinSeylan
Copy link
Owner

try like this
Vue.use(new VueSocketIO({ debug: true, connection: socketInstance, vuex: { store, actionPrefix: 'SOCKET_', mutationPrefix: 'SOCKET_' } }))

@xlkit456852
Copy link

@MetinSeylan Thank you , it works

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

6 participants