Hello all,

First, I am very much a newbie so please bear with me.

Over the last number of weeks, I have been pleased with how far I have
been able to get with APE, from successfully getting all of the demos
to work all the way up to installing the latest Git versions. Much of
it has been trial and error and I have found this group, the
documentation and wiki on http://www.ape-project.org/ and other
information I have been able to source on the web invaluable. It has
allowed me to begin to successfully adapt the Chat demo for one of our
needs, by slowly but surely gathering bits and pieces of information
from examples rather than totally understanding all the aspects of
javascript (which I surely don't yet).

However, over the last number of days I have been absolutely stumped
at understanding how to make use of sockets to get data from an
external source up to the browser while also supporting commands going
back the other way.

I was able to find this post from Anthony which was great as it
provided a detailed explanation
as to how to implement a connection between the APE server and the
outside world, (without any assumptions that the reader will know how
to fill in the blanks--or even know that there are blanks in the
explanation that might need to be filled in!). It works perfectly for
our needs and I am just trying to build on it:

> > On Feb 8, 5:59 pm, Anthony Catel <[email protected]> wrote:

> > > In fact, you can do this without any PHP code, just by using linux tools :

> > > First :

> > > - write a simple server-side JS script to bind APE on a special socket :

> > > Ape.addEvent("init", function() {
> > >      var socket = new Ape.sockServer(6971, "127.0.0.1");
> > >      socket.onRead = function(client, data) {
> > >          Ape.log(data);
> > >      }

> > > });

> > > - run this command line :

> > > $ tail -f your_file | netcat 127.0.0.1 6971

> > > This way, every file changes on "your_file" are reported to APE via the
> > > socket.

> > > Anthony

To take this data and push it to the client's browser, I have tried to
adapt and use proxy.js, I have read over and over again the various
explanations on the APE website that list sockClient and sockServer
and the callbacks and functions that relate to them and I've lost a
lot of hair over the last while as absolutely nothing has worked for
me. I am getting used to firebug error messages and "BAD PARAMS" and
am not sure whether I am "this close" to getting it or whether I have
gone down yet another one of the dozen forks in the road that end up
being dead ends.

So, would someone be so kind (please!) as to lay out the actual script
that I would need to:

1) push data that is being received from the external source (via
Anthony's example) to all users' browsers
2) send commands/data from the browser to that same socket so that it
can then be routed out to the external source

Thanks in advance to anyone who can help me out. I am excited as to
the potential of APE and yet I just can't get this part working.

-- 
You received this message because you are subscribed to the Google
Groups "APE Project" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/ape-project?hl=en
---
APE Project (Ajax Push Engine)
Official website : http://www.ape-project.org/
Git Hub : http://github.com/APE-Project/

Reply via email to