Skip to content
Socket on Javascript(use flash)
ActionScript JavaScript
Latest commit b389de1 Sep 8, 2010 @nihen upgrade as3crypto_patched
Failed to load latest commit information.
as same interface Sep 8, 2010
js add JSocketSSL (use as3crypto_patched) Sep 8, 2010
lib add JSocketSSL (use as3crypto_patched) Sep 7, 2010
submodules
swf upgrade as3crypto_patched Sep 8, 2010
.gitignore initial import Oct 19, 2009
.gitmodules add JSocketSSL (use as3crypto_patched) Sep 7, 2010
Changes add doc files Oct 21, 2009
README add doc files Oct 20, 2009

README

NAME
    JSocket - Socket on Javascript

INSTALLATION
    copy ./js/jsocket.js and ./swf/JSocket.swf to under docroot

SYNOPSIS
    1. run flashpolicyd(http://www.adobe.com/devnet/flashplayer/articles/socket_policy_files.html)
    2. in html
    <script src="/js/jquery.js"></script>
    <script src="/js/jquery-tools.flashembed.js"></script>
    <script src="/js/jsocket.js"></script>
    <script>
        JSocket.init('/static/JSocket.swf', function () {
           socket = new JSocket({
               connectHandler: connectHandler,
               dataHandler:    dataHandler,
               closeHandler:   closeHandler,
               errorHandler:   errorHandler
           });
           socket.connect(location.hostname, location.port || 80);
        });
        function connectHandler() {
            socket.writeFlush("GET / HTTP/1.0\x0D\x0A");
            socket.write("Host: " + location.hostname + "\x0D\x0A\x0D\x0A");
            socket.flush();
        }
        function dataHandler(data) {
            alert(data);
            socket.close();
        }
        function closeHandler() {
            alert('lost connection')
        }
        function errorHandler(errorstr) {
            alert(errorstr);
        }
    </script>

AUTHOR
    Masahiro Chiba<nihen@megabbs.com>
Something went wrong with that request. Please try again.