Git Product home page Git Product logo

Comments (7)

daffl avatar daffl commented on August 22, 2024 2

I would try with the default options like

import io from 'socket.io-client';

const socket = io('http://localhost:8080');

And see if the same error happens. It also depends how the application is set up (did you configure feathers-socketio properly?).

from socketio.

huytran0605 avatar huytran0605 commented on August 22, 2024

Here is error when ai use default options:

GET http://localhost:8080/socket.io/?EIO=3&transport=polling&t=LtevyLS 404 (Not Found)
Request.create @ polling-xhr.js:264
Request @ polling-xhr.js:165

XMLHttpRequest cannot load http://localhost:8080/socket.io/?EIO=3&transport=polling&t=LtevyLS. The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'. Origin 'http://localhost:3000' is therefore not allowed access. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.

Default method will be long-polling and it like we call api not found

404Route: /socket.io/?EIO=3&transport=polling&t=LtevyLS - Page not found

from socketio.

daffl avatar daffl commented on August 22, 2024

It must be something with your setup which is much easier to investigate with a repository to reproduce the issue.

from socketio.

huytran0605 avatar huytran0605 commented on August 22, 2024

Ok i will investigate more. For now, i'm using config socketIo in index.js like this

import socketio from 'socket.io';
const server = app.listen(8080);
const io = socketio(server);
server.on('listening', () =>
    logger.info(`Feathers application started on ${app.get('host')}:${port}`),
  );

from socketio.

Zalasanjay avatar Zalasanjay commented on August 22, 2024

i'm also facing problem like you @huytran0605
getting this error :
wss://ws.xxxxxxxx.xx:4038/socket.io/?EIO=3&transport=websocket' failed: Connection closed before receiving a handshake response

this is the code of my front-end in .vue file

import io from 'socket.io-client';
  import feathers from 'feathers/client';
  import socketio from 'feathers-socketio/client';

  var socket = io('wss://ws.xxxxxxxx:4038', { transports: ['websocket']})
  var app = feathers();
  app.configure(socketio(socket));
  var message = app.service('vshopdata');
  Vue.use(feathers);

this is the code of my back-end in app.js file

const express = require('@feathersjs/express');
const feathers = require('@feathersjs/feathers');
const socketio = require('@feathersjs/socketio');

const app = express(feathers());
app.configure(configuration(path.join(__dirname, '..')))

app.configure(socketio(4038, {
  wsEngine: 'uws',
  origin: '*.xxxxxx.xx:*'
}));

from socketio.

ramsestom avatar ramsestom commented on August 22, 2024

I think it is a related to a bug in the version of socket.io used by @feathersjs/socket.io that is solved with the latest version of socket.io (2.1.0): socketio/socket.io#2294
Try to update to the latest version of socket.io to see if you still have this issue

from socketio.

daffl avatar daffl commented on August 22, 2024

I felt it might be something like that given the amount of issues around Socket.io and timeouts recently. I'll make a new patch release that will use that version.

from socketio.

Related Issues (20)

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.