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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:08:21+00:00 2026-05-24T03:08:21+00:00

I am making my first app with socket.io and nodejs just as socket.io offical

  • 0

I am making my first app with socket.io and nodejs just as socket.io offical web says, but the only thing I am seeing on the html after running node server.js is “Welcome to socket.io.” How can I fix this? Or why is this happening?

The code is as follows:

index.html

<script src="http://my.page/node_modules/socket.io/lib/socket.io.js"></script>
<script>
  var socket = io.connect('http://abogados.pages/');
  socket.on('news', function (data) {
    console.log(data);
    socket.emit('my other event', { my: 'data' });
  });

</script>

server.js

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

io.sockets.on('connection', function (socket) {
  socket.emit('news', { hello: 'world' });
  socket.on('my other event', function (data) {
    console.log(data);
  });
});

I would really appreciate any answer because if not, I can’t start with socket.io!

  • 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-24T03:08:22+00:00Added an answer on May 24, 2026 at 3:08 am

    Welcome to socket.io!

    1.You should add socket.io js file just like this,

    <script src="/socket.io/socket.io.js"></script>
    

    You don’t need to address an actual file. socket.io will take care about this

    1. Hello world would be logged in your browser console, not in your document. Use Firebug or dev tools to check that out.

    2. To do something by your self, emit an event from browser and then use socket.on('your event', function(){}) and console.log the data you received form client.

    I’m new to node and socket.io too!
    🙂

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

Sidebar

Related Questions

I am working on my first iPhone app and making good progress. But there
I'm making my first web app (python+webpy+mongodb). What's the best way to make authentication
I'm making a small Adobe AIR app (my first) using HTML+Javascript. I need to
I am making my first web application with ASP.NET and I am having a
I am making good progress with my first Rails app with a lot of
I am making my first foray into scala for a production app. The app
I'm using Xode 4, and i have recently uploaded my first app... but now
First of all, Hello everyone(/world) ! I am making an Eclipse RCP app' who
I'm making my first iPhone app. I could solve most of my problems browsing
Im making my first big iphone app and I was wondering whats the best

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.