RPC middleware compatible with haxe/php server?

59 views
Skip to first unread message

David Holaň

unread,
Jul 17, 2014, 11:00:29 AM7/17/14
to haxe...@googlegroups.com

Hello,

my current project aims to create a haxe/php server and an openfl client (so far on windows but in the future I may try mobile targets too). The communication can be (and should be) stateless. I'm looking for a remote procedure call (RPC) middleware similar to haxe.remoting where you only need to define the server interface and macro magic generates stubs and skeletons so that you don't need to worry about marshaling/unmarshaling. My understanding is that remoting won't cut it since the server code exits after serving each request and remoting is intended for connection oriented communication. I have discovered the haxe.web.Dispatch and haxe.Http classess which could be used to implement such RPC middleware but I don't want to reinvent the wheel :]


I really appreciate your ideas,

David Holaň.

Juraj Kirchheim

unread,
Jul 19, 2014, 6:07:47 AM7/19/14
to haxe...@googlegroups.com
You are mistaken regarding Haxe remting. It is in fact a
request/response based protocol and is suitable to work over plain
HTTP. The best example of such usage would be haxelib, where the
command line client uses remoting over HTTP to get the job done.

Here is how the remoting is handled on the server side:
https://github.com/HaxeFoundation/haxelib/blob/master/src/tools/haxelib/Repo.hx#L41

Remoting over HTTP sets a particular header, in the presence of which
haxe.remoting.HttpConnection.handleRequest will handle it and return
true and false otherwise, so you can respond to vanilla requests all
the same.

Best,
Juraj

David Holaň

unread,
Jul 19, 2014, 12:07:55 PM7/19/14
to haxe...@googlegroups.com
Thanks, that's awesome. I'll check it out.
-David



--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
---
You received this message because you are subscribed to the Google Groups "Haxe" group.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages