THRIFT-3833 haxe http server implementation (by embeding into php web server)
Client: Haxe
Patch: Oleksii Prudkyi <Oleksii.Prudkyi@gmail.com> + some modifications by Jens Geyer
This closes #1013
This closes #1020
diff --git a/test/haxe/src/TestServer.hx b/test/haxe/src/TestServer.hx
index 8f4604a..450c8f2 100644
--- a/test/haxe/src/TestServer.hx
+++ b/test/haxe/src/TestServer.hx
@@ -42,8 +42,18 @@
transport = new TServerSocket( args.port);
case http:
trace("- http");
- throw "HTTP server not implemented yet";
+ #if !phpwebserver
+ throw "HTTP server not implemented yet";
//transport = new THttpServer( targetHost);
+ #else
+ transport = new TWrappingServerTransport(
+ new TStreamTransport(
+ new TFileStream("php://input", Read),
+ new TFileStream("php://output", Append)
+ )
+ );
+
+ #end
default:
throw "Unhandled transport";
}
@@ -84,7 +94,12 @@
switch( args.servertype)
{
case simple:
- server = new TSimpleServer( processor, transport, transfactory, protfactory);
+ var simpleServer = new TSimpleServer( processor, transport, transfactory, protfactory);
+ #if phpwebserver
+ simpleServer.runOnce = true;
+ #end
+ server = simpleServer;
+
default:
throw "Unhandled server type";
}