Coder Social home page Coder Social logo

flashsocket's Introduction

FlashSocket.js

FlashSocket is a JavaScript/Flash library which adds WebSocket support to old browsers such as IE6.

This project is aimed to enable WebSocket in old browsers while maintaining a decent performance.
Currently all features are implemented but still in a beta state.

If IE6 support is not required I highly recommend you use one of the libraries listed below. They are more stable and well maintained.
https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-browser-Polyfills

Example

<!DOCTYPE html>
<html>
<script src="swfobject.js"></script>
<script src="flashsocket.js"></script>
<script>
var socket = new FlashSocket("ws://localhost:8080/websocket");

socket.onopen = function (e) {
    console.log("Socket opened");
    socket.send("hello world");
};
socket.onmessage = function (e) {
    console.log("Recieved message: " + e.data);
    socket.close();
};
socket.onclose = function (e) {
    console.log("Socket closed");
};
</script>
</html>

Client Requirements

Adobe Flash Player 9 or above.

Tested browsers

  • Internet Explorer: 6 and 9
  • Opera 11.62
  • Firefox 3.6.16
  • Safari 5.1.5 (Win7)

Dependencies

SWFObject 2.2

flashsocket's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.