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 8317691
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T21:41:33+00:00 2026-06-08T21:41:33+00:00

I’d like to use Socket.io and Node.js to do push notifications. The end goal

  • 0

I’d like to use Socket.io and Node.js to do push notifications. The end goal is to do something similar to what Stackoverflow does with their commenting to notify people of new comments.

My site is in PHP and runs on Apache on an EC2 instance. I’ve heard that Apache doesn’t handle concurrency well so I’m interested in using Node to handle the hopefully large # of simultaneous, persistent connections. I guess there are two solutions:

  1. Put Node on same instance as Apache and proxy the two servers
  2. Put Node on a separate instance

In either case, I don’t know how the connection between these two servers looks programmatically. For example, while WebSockets/Node handles the sending/receiving of messages, I need to store these messages in my MySQL database and that would require some PHP code, yes/no? Also, how is the message received on my PHP page? Via a $.post to a url like this, http://mysite/receiver.php that would be resolved by my Apache server?

I’d be happy to see either comments or code to help me understand this better.

  • 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-06-08T21:41:36+00:00Added an answer on June 8, 2026 at 9:41 pm
    • You can run different servers at different ports.
    • In order for the servers to communicate in a way you can use Sessions/MySQL/flat files/Cache/json/xml…
    • You can store messages wherever you want there is no limitation on that, MySQL module for node.js exists, memcache module for node.js exists and many more, PHP code is not required, its optional to query the database.
    • The messages on your PHP page are fetched from your database and rendered, if node.js stores stuff in mysql server you can fetch them with PHP or temporarily store to an array and push messages back to client while you store into database for new users to have “current” content.
    • Avoid using ajax since you can stream data to client via websockets in realtime use when needed.

    — Edited
    Some additional information on How to use vhosts alongside node-http-proxy? link provided from Timothy Strimple at comments , thanks

    Some MySQL drivers can be found in this question What MySQL drivers are available for node.js?

    About configuring ports:
    -On apache you need to manually edit httpd.conf to define default port
    -On node.js things are simpler and you can define a port in code
    Using node.js as a simple web server

       var connect = require('connect');
        connect.createServer(
         // .. code
        ).listen(PORT);
    

    hope it helped

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I've got a string that has curly quotes in it. I'd like to replace
I would like to run a str_replace or preg_replace which looks for certain words
I am trying to render a haml file in a javascript response like so:
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this

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.