[Klone-users] Create request
Mickael Auger
mickael.auger at gmail.com
Tue May 5 08:23:45 EDT 2009
Hi Thomas,
I would prefer to use Klone internal mechanisms to minimize the size of my
executable.
Moreover the KLone mechanism works well ;)
My first need is sample. I want only get a page of another server with
GET/POST parameters. And send the same contents without any treatment (at a
first time, and transform or filter data at a second time).
For example :
My AJAX request get a page (ex: page1.xml) to my KLone server (server A),
this server requests this page to another server (server B). Server B send
page1.xml to server B, and this last server send page1.xml to Javascript.
The server A is is running on a first machine and the server B is ruunnig on
another machine, so my AJAX request cannot get a page on server B cause it's
a remote server.
Schema :
AJAX --(page1.xml)-> KLone server --(page1.xml)-> other server -\
|
AJAX <-(page1.xml)-- KLone server <-------------(page1.xml)------------/
2009/5/4 thomas fossati <tho at koanlogic.com>
> Hi Mickael,
>
> On May 4, 2009, at 6:07 PM, Mickael Auger wrote:
>
> Hi KLone team,
>
> I wish create a HTTP request to get a Web page of another server from a KL1
> page.
> I have two servers that communicate with each.
>
> For example :
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> Server 1:
> - page1.kl1
>
> Server 2 :
> - page2.kl1
>
> "page1.kl1" gets "page2.kl1" (to transform or filter XML data) with
> "page2.kl1" delivers a XML page.
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>
> What functions can I use ?
>
>
> so you need to speak a little bit of client side HTTP from inside a kl1
> page.
>
> Basically you have two options:
> (1) use off-the-shelf HTTP library code (e.g. libcurl);
> (2) create the client code you need by yourself by reusing klone internal
> mechanisms (libio/libpage).
>
> The choice depends on (at least) two factors: the complexity of your
> protocol (i.e. basic GET/POST over HTTP/S vs ...), and the need to minimize
> the size of your executables.
>
> Implementing (2) should be roughly 200/300 lines of C code - which means a
> non-significant increment in overall size.
>
> On the other side, doing (1) with libcurl can be 1/5 of complexity but a 2M
> increment if you link it statically ...
>
> The choice is up to you :) anyway, if you decide to go for (1) and need
> some hint/help, just ask !
>
> ciao, t.
>
> _______________________________________________
> Klone-users mailing list
> Klone-users at koanlogic.com
> http://koanlogic.com/cgi-bin/mailman/listinfo/klone-users
>
>
--
Mickaël AUGER
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://koanlogic.com/pipermail/klone-users/attachments/20090505/ffb670b0/attachment.htm
More information about the klone-users
mailing list