Git Product home page Git Product logo

egg-websocket-plugin's People

Contributors

flarestart avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

egg-websocket-plugin's Issues

感谢作者

eeg官方的socket.io不能用原生来直接链接,正想自己搞就发现了这个,谢谢作者的分享

连接后瞬间断开,并且无任何打印信息

// app/router.js

app.ws.route('/ws', wsBuild, controller.law.xxx)
// app/controller/law.js
async xxx() {
    const { ctx, app } = this;
    if (!ctx.websocket) {
      throw new Error('this function can only be use in websocket router');
    }

    console.log('client connected');

    ctx.websocket
      .on('message', (msg) => {
        console.log('receive', msg);
      })
      .on('close', (code, reason) => {
        console.log('websocket closed', code, reason);
      });
  }
// app/middleware/wsBuild.js
'use strict';

module.exports = () => {
  return async function wsBuild(ctx, next) {
    console.log('xxxx')
    await next();
  };
};

image
并且没有打印出任何信息

PS: config.default.js未做任何配置

配置信息

    "egg": "^2.15.1",
    "egg-websocket-plugin": "^1.0.1",

egg3.5安装报错

您好,我一直使用你这个插件,但eggs升级,安装的时候出现错误,请问可以解决吗?:

npm resolution error report

While resolving: [email protected]
Found: [email protected]
node_modules/egg
egg@"^3" from the root project

Could not resolve dependency:
peer egg@"^2.26.0" from [email protected]
node_modules/egg-websocket-plugin
egg-websocket-plugin@"*" from the root project

Fix the upstream dependency conflict, or retry
this command with --force or --legacy-peer-deps
to accept an incorrect (and potentially broken) dependency resolution.

open事件不相应

image
如图,应该是先open再获取信息,但是 获取信息相应了open没有响应

升级反馈

作者您好,现在,我一直使用您这个插件,方法也写差不多了,上次我给你反馈安装出现错误后,你对插件进行了升级。但是,我并没有忙于升级,而是用你未升级的版本测试一下,能不能用,经过我的测试,发现是可以用的,我也写了很多方法,socket连接,接收消息,都是没有问题的,
但是,今天,我需要安装一个二维码的库,我安装的时候出现错误提示,提示不能安装,但我看到反馈的错误信息,竟然是和你的这个插件有关,反馈如下:
`npm install qr-image
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/egg
npm ERR! peer egg@"^3.12.0" from [email protected]
npm ERR! node_modules/egg-mock
npm ERR! peerOptional egg-mock@">=5.8.3" from [email protected]
npm ERR! node_modules/egg-bin
npm ERR! dev egg-bin@"^5" from the root project
npm ERR! dev egg-mock@"^5" from the root project
npm ERR! egg@"^3" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer egg@"^2.26.0" from [email protected]
npm ERR! node_modules/egg-websocket-plugin
npm ERR! egg-websocket-plugin@"^1.0.1" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: [email protected]
npm ERR! node_modules/egg
npm ERR! peer egg@"^2.26.0" from [email protected]
npm ERR! node_modules/egg-websocket-plugin
npm ERR! egg-websocket-plugin@"^1.0.1" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR!
npm ERR! For a full report see:
npm ERR! C:\Users\Administrator\AppData\Local\npm-cache_logs\2023-05-08T02_55_59_318Z-eresolve-report.txt

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Administrator\AppData\Local\npm-cache_logs\2023-05-08T02_55_59_318Z-debug-0.log`

我想再重新安装一下你更新后的插件,也是类似的提示,安装不上,是不是需要把你的老版本卸载后再进行安装?如果那样的话,会不会影响到我已经写好的控制器方法?所以想先向您咨询一下后再下手

`H:\NodeJSProjects\仿微信\egg-wechat> npm i egg-websocket-plugin --save
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/egg
npm ERR! egg@"^3" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer egg@"^2.26.0" from [email protected]
npm ERR! node_modules/egg-websocket-plugin
npm ERR! egg-websocket-plugin@"^1.0.1" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR!
npm ERR! For a full report see:
npm ERR! C:\Users\Administrator\AppData\Local\npm-cache_logs\2023-05-08T05_13_10_073Z-eresolve-report.txt

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Administrator\AppData\Local\npm-cache_logs\2023-05-08T05_13_10_073Z-debug-0.log
PS H:\NodeJSProjects\仿微信\egg-wechat> npm i egg-websocket-plugin
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/egg
npm ERR! egg@"^3" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer egg@"^2.26.0" from [email protected]
npm ERR! node_modules/egg-websocket-plugin
npm ERR! egg-websocket-plugin@"^1.0.1" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR!
npm ERR! For a full report see:
npm ERR! C:\Users\Administrator\AppData\Local\npm-cache_logs\2023-05-08T05_14_47_724Z-eresolve-report.txt

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Administrator\AppData\Local\npm-cache_logs\2023-05-08T05_14_47_724Z-debug-0.log`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.