Skip to content

例子中的配置文件的含义 #3

@llqgit

Description

@llqgit
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');

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions