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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:09:26+00:00 2026-06-11T14:09:26+00:00

I am using a notification system on node.js and i am trying to use

  • 0

I am using a notification system on node.js and i am trying to use curl in php and push notification to it.

However, each time I use curl in terminal or php, it not returns anything but the notification, indeed, is pushed.

How can I make this code return 200 instead of return nothing and keep curl running until timeout?

/* CONFIGURATION */

/* Web Server Config */
var _postpath = '/send';
var _listenport = 8888;
var _listenaddr = '0.0.0.0';  //use '0.0.0.0' to listen on all interfaces

/* Slave (sub) Redis Server Config */
var _channelfilter = '*';
var _sub_db_addr = '127.0.0.1';
var _sub_db_passwd_protected = true;
var _sub_db_passwd = 'secret';
var _sub_db_port = 6379;  //default redis port is 6379

/* Master (pub) Redis Server Config */
var _pub_db_addr = '127.0.0.1';
var _pub_db_passwd_protected = true;
var _pub_db_passwd = 'secret';
var _pub_db_port = 6379;  //default redis port is 6379

/* SocketIO Config */
var _loglevel = 1;

/* simple-pub-sub Config */
var _secretkey = "secret";


/* SERVER CODE -- DO NOT MODIFY */
redis = require('redis');
express = require('express');
socketio = require('socket.io');
fs = require("fs"),
pub = redis.createClient(_pub_db_port, _pub_db_addr); if (_pub_db_passwd_protected) {  }

sub = redis.createClient(_sub_db_port, _sub_db_addr); if (_sub_db_passwd_protected) { }
sub.on("pmessage", function(pattern, channel, json) { io.sockets.volatile.emit(channel, JSON.parse(json)); });
sub.psubscribe('*');

app = express.createServer(express.static(__dirname + '/public'),express.bodyParser());
app.listen(_listenport, _listenaddr);
app.post(_postpath, function(req, res){
  if(req.body.secretkey==_secretkey){
    delete req.body.secretkey; pub.publish(req.body.channel, JSON.stringify(req.body))
  }
});

io = socketio.listen(app);
io.configure(function () { io.set('log level', _loglevel) });

Thank you!

  • 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-11T14:09:27+00:00Added an answer on June 11, 2026 at 2:09 pm

    Just send on the post a 200 code

    app.post(_postpath, function(req, res){
      if(req.body.secretkey==_secretkey){
        delete req.body.secretkey; pub.publish(req.body.channel, JSON.stringify(req.body));
        res.send(200);
      }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using AJAX extensively and my PHP based notification system was not sufficient.
I am trying to send push notification to iPhone using Java-pns but I am
I have developed push notification system in android using c2dm, It's working fine but
HI, I am trying to send a simple notification using system.net.mail.mailmessage. I just pass
Possible Duplicate: javascript: pause setTimeout(); Im using jQuery and working on a notification system
I am doing push notification for android using C2DM. it works well. but while
I am using a jQuery notification system who runs when the user click on
i need a rundown on how to fully utilise the push notification system. Iv
I have a PHP notification system, and the amount of notifications is put into
there's a freedesktop.org notification system using DBUS. Looks simple enough, but I just can't

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.