Permalink
Browse files

Js->server connection on neko servers as well

  • Loading branch information...
waneck committed Sep 5, 2012
1 parent 4abce44 commit 9de3d23f52208603f6505fe47ad6c6f903284e36
Showing with 8 additions and 3 deletions.
  1. +7 −2 haxelib/croxit/remoting/AsyncConnection.hx
  2. +1 −1 haxelib/haxelib.xml
@@ -63,8 +63,13 @@ class AsyncConnection implements haxe.remoting.AsyncConnection, implements Dynam
catch(e:Dynamic) { trace("error on " + e); }
}
- public static function connect() {
- return new AsyncConnection({ error : function(e) untyped __js__("console.error")("(connection) " + e), hasHandler : false },[]);
+ public static function connect(url:String="/"):haxe.remoting.AsyncConnection
+ {
+ //TODO find a better way to detect the croxit environment
+ if (croxit.js.Client.baseDir == null)
+ return haxe.remoting.HttpAsyncConnection.urlConnect(url);
+ else
+ return new AsyncConnection({ error : function(e) untyped __js__("console.error")("(connection) " + e), hasHandler : false },[]);
}
public static function addObject(name:String, obj:Dynamic, ?rec):Void
View
@@ -8,6 +8,6 @@
<tag v="neko"/>
<tag v="hxcpp"/>
<description>Croxit is a library that enables Haxe-written HTML5/JS applications to run on a cross-platform, offline environment. It emulates the neko.Web API and allows client/server-style applications to run offline on a mobile or desktop device.</description>
- <version name="0.0.2">Added ARMv7 ndlls.</version>
+ <version name="0.0.3">Added support for using js->server connection on neko servers as well.</version>
<depends name="hsl-pico-1"/>
</project>

0 comments on commit 9de3d23

Please sign in to comment.