probil / vue-socket.io-extended

:v::zap: Socket.io bindings for Vue.js and Vuex (inspired by Vue-Socket.io)
MIT License
628 stars 38 forks source link

how to set header? #469

Closed gzg1500521074 closed 4 years ago

gzg1500521074 commented 4 years ago

import VueSocketIOExt from 'vue-socket.io-extended' import io from 'socket.io-client' const socket = io('http://127.0.0.1:3000',{ transports: ['websocket'], autoConnect:false, debug: true, query:{ name: "guozg" }, transportOptions: { polling: { extraHeaders: { Authorization: "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXV" } } } }) Vue.use(VueSocketIOExt, socket)

gzg1500521074 commented 4 years ago

give up set header