Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6717967
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:54:52+00:00 2026-05-26T08:54:52+00:00

Realtime Update Mechanism : user writes -> php save it in mysql db ->

  • 0

Realtime Update Mechanism : user writes -> php save it in mysql db -> php send info to nodeJS -> nodeJS send the change all subscribers -> others can notice it in realtime.

The Socket.io server works well and runs on port 8080. I have node http server running on port 80. How can I get a trigger message on the http server and send the message to all socket.io clients?

var io = require('socket.io').listen(8080);

var http = require('http');
http.createServer(function (req, res) {
  res.writeHead(200, {'Content-Type': 'text/plain'});
  res.end('Message Broadcast\n');
  console.log("Message Sent");

  //DOES NOT SEEM TO WORK, error
  io.broadcast("Messages");

  //No error but no messages
  io.emit("Message");

}).listen(80, "0.0.0.0");


/**
Other socket.io code which works well..
....
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T08:54:53+00:00Added an answer on May 26, 2026 at 8:54 am

    In Socket.IO 0.7 you should use the following instead to send to all connected sockets without a specific socket reference:

    io.sockets.send("Messages")

    Note that this is different to broadcast since that would send to all sockets except the socket that initiated the connection – of course you require a sending socket reference which is why your current code wouldn’t suffice.

    Quote from the wiki page: Socket.IO/Wiki

    If you want to send a message to everyone you can reference io.sockets:

    io.sockets.send('message');

    io.sockets.emit('event');

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to update pin callout (popup) subtitle either realtime, when I receive some
I am developing a website that has some sort of realtime update. Now the
Update: I have now written a PHP extension called php_ssdeep for the ssdeep C
i currently have highcharts realtime graph working on a browser (e.g. http://www.highcharts.com/demo/dynamic-update ), but
Is it possible to force all clients to update using socket.io? I've tried the
I am developing an application which requires real-time updates to the end user. However,
I have a pseudo-realtime data processing application where I would like to use LazyInit<double>
I'm looking for suggestions on Flash realtime servers. Currently, we use a combination of
Is there a good 3d realtime software renderer with features similar to OpenGL/DirectX? Something
I'm working on a realtime imaging system. UI thread: grabs images from a camera

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.