Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

223
Views
React Native: How to integrate Socket.io with Sails.js?

I have the following, a simple server and client connection with Express using NodeJS:

var express = require('express');
var http = require('http')
var socketio = require('socket.io');

var app = express();
var server = http.Server(app);
var websocket = socketio(server);
server.listen(3000, () => console.log('Listening to: 3000'));

// The event will be called when a client is connected.
websocket.on('connection', (socket) => {
  console.log('Client just joined with ', socket.id);
});

and:

import React from 'react';
import SocketIOClient from 'socket.io-client';

class Main extends React.Component {
  constructor(props) {
    super(props);

    // Creating the socket-client instance will automatically connect to the server.
    this.socket = SocketIOClient('http://localhost:3000');
  }
}

module.exports = Main;

Would simply want a chat room between two people, and a list of those chat rooms with persistent messages. But I’ve integrated the project with Sails.js, and was wondering how I should handle it with Socket.io?

Thank you in advance and will be sure to vote up/accept answer

about 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!