thinkjs2-demos
thinkjs2-demos copied to clipboard
例子中的配置文件的含义
export default {
on: true, //是否开启 WebSocket
type: "socket.io",
allow_origin: "",
sub_protocal: "",
adapter: undefined,
path: "", //url path for websocket
messages: {
open: 'home/index/open',
close: 'home/index/close',
chat: 'home/index/chat',
typing: 'home/index/typing',
stoptyping: 'home/index/stoptyping',
adduser: 'home/index/adduser'
}
};
请问,这个里边的 path 是什么意思path: "", //url path for websocket
allow_origin: "",
sub_protocal: "",
adapter: undefined,
虽然这三个还没用到,但是也不知道什么意思,官网的doc说的也不充分。
我想在 websocket 的 url 上加一个路径,然后能够这样连接 socket.io
io('http://127.0.0.1:8080/test');
遇到了同样的问题,加了官方群,发现都是一群吹逼的人,哎……