Coder Social home page Coder Social logo

aravindmathradan / socket.io-client Goto Github PK

View Code? Open in Web Editor NEW

This project forked from socketio/socket.io-client

1.0 1.0 0.0 5.92 MB

Realtime application framework (client)

Home Page: http://socket.io

License: MIT License

JavaScript 11.21% TypeScript 88.79%

socket.io-client's Introduction

socket.io-client

Build Status Dependency Status devDependency Status NPM version Downloads

Sauce Test Status

How to use

A standalone build of socket.io-client is exposed automatically by the socket.io server as /socket.io/socket.io.js. Alternatively you can serve the file socket.io.js found in the dist folder or include it via CDN.

<script src="/socket.io/socket.io.js"></script>
<script>
  var socket = io();
  socket.on('connect', function(){});
  socket.on('event', function(data){});
  socket.on('disconnect', function(){});
</script>
// with ES6 import
import io from 'socket.io-client';

const socket = io();

A slim build (without debug) is also available: socket.io.slim.js.

Socket.IO is compatible with browserify and webpack (see example there).

Node.JS (server-side usage)

Add socket.io-client to your package.json and then:

var socket = require('socket.io-client')('http://localhost:3000');
socket.on('connect', function(){});
socket.on('event', function(data){});
socket.on('disconnect', function(){});

Debug / logging

In order to see all the client debug output, run the following command on the browser console โ€“ including the desired scope โ€“ and reload your app page:

localStorage.debug = '*';

And then, filter by the scopes you're interested in. See also: https://socket.io/docs/logging-and-debugging/

API

See API

License

MIT

socket.io-client's People

Contributors

3rd-eden avatar alexlmeow avatar crickeys avatar danielbeardsley avatar darrachequesne avatar defunctzombie avatar digawp avatar dvv avatar einaros avatar fat avatar felixge avatar gabehollombe avatar grant avatar holic avatar jdahlq avatar kevin-roark avatar masakij avatar michael-luo avatar mikelimantara avatar nkzawa avatar paladox avatar paradite avatar pedrorw avatar peterdavehello avatar rase- avatar rauchg avatar sfilatov avatar tootallnate avatar ycarmel avatar zweihan avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.