Skip to content
This repository has been archived by the owner on Mar 21, 2020. It is now read-only.

默认通道能不能替换 #7

Open
fyddaben opened this issue Jan 9, 2017 · 1 comment
Open

默认通道能不能替换 #7

fyddaben opened this issue Jan 9, 2017 · 1 comment

Comments

@fyddaben
Copy link

fyddaben commented Jan 9, 2017

小程序里面这样写是可以的,

wx.connectSocket({
       url: 'wss://xxxx.com/user/??EIO=3&transport=websocket',
 })

在socket.io的客户端是这样写的

io.connect('//xxxx.com',{path:'/user'});

在你这里应该咋写,写成?path=user也不管用啊,貌似加了个默认通道socket.io,
控制台报错,连接地址为

wss://xxx.com/socket.io/?path=/user/&EIO=3&transport=websocket'

这个了,

@gongzili456
Copy link
Member

gongzili456 commented Jan 9, 2017

@fyddaben 替换默认 path 的方法确实是 {path: '/path' }, 只是没有对外暴露 connect 方法,
可以这样使用 io('ws://domain', {path: '/path' })

有关 querystring 的使用在问题 #5 里面有解答.

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

No branches or pull requests

2 participants