Data streaming
  • I am trying to make a location-based game based on Mapattack where street runners can interact with web players.
    It requires location-streaming on web browsers.

    Mapattack, all data streaming on iphone is perfect, but streaming does
    not work on web portal(The web portal never update game status after

    By checking debug console, I find a request  to '' is always aborted  when web portal is loading.

    What would be the most probable problem here?

    I thought it might be a problem of my network, but I moved my mapattack
    server (my laptop) to different networks, it does not help either.

    p.s. I can not find documentations of geoloqi streaming API, it makes me struggling when I deal with issues of data streaming.

    If it is not documented currently, could you give me a very brief
    explanation about how it works, or some references that is worth

    thank you in advance :)
  • 10 Comments sorted by
  • We're still working on the documentation for our Streaming API. In the mean time you can find some sample code in the geoloqi-js project as well as the MapAttack project.

    The way the streaming API works from the web is by connecting to the server at This is running on port 443 over SSL. Some browsers don't show the WebSockets connection in the debug console, but if you use a browser that doesn't support WebSockets, you should see it fall back to long-polling and you'll see a bunch of requests in the console.

    In your mapattack-web.js file, try changing the connect line to look like this:

    var socket = io.connect("");

    I think the problem is that because there is no port specified, the library is defaulting to the port your Sinatra app is running on.

    Let me know if that helps!
  • It works like magic! Thank you so much! 
  • Hi, aaronpk

    another question.
    Is it possible to up stream some information to qeoloqi from web portal (using
    I want to let online player control virtual objects moving around map and synchronous location of objects to all devices.
    currently I use ajax as a workaround but the result is not ideal :(
  • There is a way to do this, actually. We do this in MapAttack to push messages to the clients when someone captures a coin. 

    This works by creating a "group" and having all your players join the group. Members of the group have the ability to publish custom messages to the group in addition to receiving all the streaming location information from everyone who has joined the group. You can see this in action in the MapAttack code here:

    Whatever JSON you publish to a group will be sent down the stream to anybody listening to that group.

    Hope this helps!

  • Thank you very much for your reply

    In Mapattack The data flows this way.

    mobile client    ---(udp) -->   geoloqi    ---(>   web browser.

    in my understanding, the web browser is designed to listen to server.

    but I want data flows this way:

    web browser    ---( -->   geoloqi    ----->   mobile clients

    browser will not only listen, but also publish data to the group. 

    In mapattack-web.js, I find the code for setting up connection and listen to 'group' event. Based on code that code, I have tried to send back a group event to geoloqi:

    socket.emit('group', { user_id :"xxx",latitude:"xxx",longitude:"xxx"});

    Will geoloqi response to such a 'group' event? or is there a "geoloqi API" exists?

    currently I am using ajax to communicate to game server, then game server publish data to group

    (web browser --(ajax)--> game server --> geoloqi --> mobile clients)

    but http request is not responsive enough for my game

  • Hi, 
    This is a bit urgent!
    I suspect your UDP server is not working correctly now. I have to do a demo of my game tomorrow :(
    I am not 100% sure it is your server's problem, but I have some reasons make me believe it is likely your server's problem.

    1) It is not a problem of my game sourcecode:
    To test, I built the totally unmodified sourcecode of mapattack (iphone) and connect to your game server and join game "infinie loop", the UDP do not work.

    2) It is not a problem of my network: 
    I build client into iphone(not simulator) and use carrier's 3G network, so it is not behind any firewall or proxy. 

    The massage from console:

    /-[GeoloqiSocketClient onUdpSocket:didSendDataWithTag:] (GeoloqiSocketClient.m:243) 

    [Write] did send

    it just kept sending position data,  not receiving anything. It worked perfectly days before, but it suddenly do not work now. Could you check your server once you see this massage? My demo is just hours later...

  • I'm looking into this now, can you also hop in our IRC channel? There is info here:
  • Can you try changing the host name you're connecting to instead of 
  • Thank you for your quick help. but seems not work!
    I will keep myself updated by watching on IRC!
  • Can you give it another try now?

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion