Coder Social home page Coder Social logo

haxe-ws's Introduction

Haxelib Version

WebSockets everywhere! Including javascript, flash and sys targets.

class WebSocketExample {
    static public function main() {
        trace('testing!');
        var ws = WebSocket.create("ws://127.0.0.1:8000/", ['echo-protocol'], false);
        ws.onopen = function() {
            trace('open!');
            ws.sendString('hello friend!');
        };
        ws.onmessageString = function(message) {
            trace('message from server!' + message);
        };

        #if sys
        while (true) {
            ws.process();
            Sys.sleep(0.1);
        }
        #end
    }
}

haxe-ws's People

Contributors

imcasper avatar markknol avatar mepsoid avatar realyuniquename avatar romamik avatar romanmikhailov avatar sh-dave avatar soywiz avatar tecteun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

haxe-ws's Issues

Done to the Haxe Foundation

Since I do not have too much time lately for this.

Does somebody knows how to donate this project to the Haxe Foundation? Or to someone else?
I have tried for example to change the password of haxelib but I think it is not possible at least directly. So I don't know if it is possible to change the user who can push new versions.

A server must not mask any frames that it sends to the client.

Hello,

I have the following error using haxe-ws (only on Chrome and Opera). It seem to work fine on Firefox.

WebSocket connection to 'ws://localhost:8582/' failed: 
A server must not mask any frames that it sends to the client.

What I am doing wrong?

WebSocketFlashExternalInterface

Data transmission does not work. I use flash in browser -> WebSocket realization -> WebSocketFlashExternalInterface. Did not look in detail

Wrong serialization with ByteArray type

When library works as flash target inside browser it uses internal js websockets at class WebSocketFlashExternalInterface. Both functions sendBytes(message:Bytes) and sendString(message:String) have same implementation. But when I'm sending some ByteArray (=haxe.io.Bytes at flash target) data it's serialized like [object Object] and sending as text frame instead of binary one.
Anyway implementation for local flash run WebSocketGeneric works fine.
I suppose that this js wrapper was made to evade security issues with requesting policy by flash player. But this implementation doesn't work as expected at all.

Socket connect() will block the thread

Currently connect() will block the current thread, so if your server is having high latency it could be waiting for this for a few seconds or until timeout (around 30sec?).

Seems fine on Flash didn't try it on HTML5 but definitely an issue on hxcpp target.

My plan to work around this is creating a wrapper over this class and use a Thread?

Is this project dead?

I get the following when trying to run example:

WebSocket connection to 'ws://localhost:8000/' failed: Error during WebSocket handshake: Unexpected response code: 404

And it seems the author no maintains this project is that accurate? Has anyone managed to get this to work?

Cheers,
Ian

Can't compile to Neko.

Getting this error when trying to compile on neko:

Called from sys/ssl/Socket.hx line 68
Uncaught exception - load.c(237) : Failed to load library : hxssl.ndll

Same with openfl-websocket.

haxelib release

Are going to publish latest version on haxelib any time soon?

Java and CS targets do not compile.

Java and CS targets do not compile under Haxe 3.4.2 (build 2017-03-20: 3.4.2)

In Java:
src/haxe/net/impl/SocketSys.java:98: error: package sys.ssl does not exist
this.impl = new sys.ssl.Socket()
java.net.SslSocket should be used instead for Java when creating a SSL socket.

In CS:
/usr/local/lib/haxe/lib/haxe-ws/1,0,5/src/haxe/net/impl/SocketSys.hx:51: characters 32-55 : Cannot access private field host

Premature `onopen()` call

onopen() handler is called before changing connection state.

So if user try to send data in onopen handler, then exception websocket is not open is thrown.

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.