Git Product home page Git Product logo

Comments (15)

ptejada avatar ptejada commented on June 2, 2024

Try joining a channel instead of using connect()

from apepubsub.

 avatar commented on June 2, 2024
//aps.connect();
aps.sub('main', { joined: function(){ console.log('joined'); } });
  • First page load
    s1
  • Second page load
    s2

from apepubsub.

ptejada avatar ptejada commented on June 2, 2024

Wierd, I'll look into this.

from apepubsub.

 avatar commented on June 2, 2024

On demo, after RESTORE, from the server is coming IDENT raw
s1

But in my case this is not happening
s2

from apepubsub.

lcharette avatar lcharette commented on June 2, 2024

Which version of the server are you using? Did you update the server side scripts and restarted the server afterward?

  • Louis

Le 2014-06-08 à 13:35, moldcraft [email protected] a écrit :

On demo, after RESTORE, from the server is coming IDENT raw

But in my case this is not happening


Reply to this email directly or view it on GitHub.

from apepubsub.

 avatar commented on June 2, 2024

@lcharette I use latest version with updated server scripts.

Now I am debugging APE_Server/APScripts/framework/cmd_restore.js

When I add
info.user.pipe.sendRaw('TEST_OK', {test: 'ok'});
it works
s1

But when I try to access somehow info.user.channels
info.user.pipe.sendRaw('TEST_OK', {channels: info.user.channels});
it does nothing
s2
I think it's crashing, gives some fatal error.

In ape.log nothing appears. Is there any error.log I can look in?

I tried to run aped as root, nothing changes

from apepubsub.

ptejada avatar ptejada commented on June 2, 2024

Hey,

It must be something with some custom server script. Even your initial example works as expected when tested with the server ape.ptejada.com.

http://jsfiddle.net/6sUvY/

Try unloading any custom scripts from your server.

from apepubsub.

 avatar commented on June 2, 2024

I have no custom scripts (and I think I will not have in the near future, I use only 'inlinepush' from PHP and I think this is all my application will need)

Here is another debug I did in APE_Server/APScripts/framework/cmd_restore.js

//...
for(var name in info.user.channels){
    info.user.pipe.sendRaw('DEBUG1', {i: name});
    var channel = info.user.channels[name];
    Ape.triggerChannelEvent(channel, "restored", [info.user, channel]);
    Ape.triggerChannelEvent(channel, "pleaseWork", [info.user, channel]);
    info.user.pipe.sendRaw('DEBUG2', {i: name});
}
//...

s1

So Ape.triggerChannelEvent() is not working and not showing any errors.

from apepubsub.

 avatar commented on June 2, 2024

Now I reinstalled everything (all my workspace is inside docker).

  • APE Server compilation log

  • APE Server v1.1.3-DEV

  • uname -a

    Linux 3f0d68ad9e33 3.13.0-29-generic #53-Ubuntu SMP Wed Jun 4 21:00:20 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
    
  • lsb_release -a

    No LSB modules are available.
    Distributor ID: Ubuntu
    Description:    Ubuntu 12.04.4 LTS
    Release:    12.04
    Codename:   precise
    

Nothing changes, the bug is still there

from apepubsub.

ptejada avatar ptejada commented on June 2, 2024

Have you tried not using the secure flag. Also try using the long polling
transport by setting the option transport: 'lp' and checking the network
requests on DevTools.

It seems the server is not handling the RESTORE command at all.

Can you also provide the console output when you start the server in the
foreground.
On Jun 9, 2014 5:38 AM, "moldcraft" [email protected] wrote:

Now I reinstalled everything (all my workspace is inside docker
http://www.docker.com/). Here is APE-Server compilation log
http://sourcebox.io/d2b8405d57ede898d34ff21c55edc5d9. APE Server
v1.1.3-DEV

Nothing changes


Reply to this email directly or view it on GitHub
#24 (comment).

from apepubsub.

 avatar commented on June 2, 2024

Now I tried secure:false, moved everyting from https to http, transport:lp, nothing changed.

Console output:

[WARN] You have to run 'aped' as root to increase r_limit
   _   ___ ___ 
  /_\ | _ \ __|
 / _ \|  _/ _| 
/_/ \_\_| |___|
AJAX Push Engine

Bind on : 0.0.0.0:6969
Pid     : 529
Version : 1.1.3-DEV
Build   : Jun  9 2014 09:18:22
Author  : Weelya ([email protected])

[Module] [spidermonkey] Loading module : Javascript embedded (0.01) - Anthony Catel
[spidermonkey] : Loading script ../APScripts/framework/utils.js
[spidermonkey] : Loading script ../APScripts/framework/Request.js
[spidermonkey] : Loading script ../APScripts/framework/cmd_frame.js
[spidermonkey] : Loading script ../APScripts/framework/cmd_eventpush.js
[spidermonkey] : Loading script ../APScripts/framework/cmd_restore.js
[spidermonkey] : Loading script ../APScripts/framework/cmd_event.js
[spidermonkey] : Loading script ../APScripts/framework/cmd_inlinepush.js
[spidermonkey] : Loading script ../APScripts/framework/cmd_propupdate.js
[spidermonkey] : Loading script ../APScripts/framework/cmd_session_set.js
[spidermonkey] : Loading script ../APScripts/framework/hook_join.js
[spidermonkey] : Loading script ../APScripts/framework/hook_connect.js
[spidermonkey] : Loading script ../APScripts/framework/hook_events.js
[spidermonkey] : Loading script ../APScripts/framework/options.js
[spidermonkey] : Loading script ../APScripts/config.js

I found the problem.

I want to make my site on https, and if main https page tries to make request to http urls, the browser does not allow that.

s2

On APE I can't install ssl certificates so I use nginx in the middle.

My nginx config

server {
        listen 443;
        server_name ~^\d+\.mydomain\.dev$;

        location / {
                proxy_pass http://127.0.0.1:6969;
        }
}

When I changed transport:lp, the request for cmd:RESTORE was pending for some time, then it stoped with 502 bad gateway.

When I connected directly to APE port (without nginx in the middle)

var aps = new APS( window.location.host +':6969', ... );

Everything started to work

s1


Sorry for taking your time because that was my fault. (also sorry for my english)

But here are some questions:

  • Why other commands work but RESTORE doesn't ?
  • How can I use APE on https site ?

(now I will try to find out maybe my nginx config is too simple and I need to put there some parameters for proxy to work properly)

from apepubsub.

 avatar commented on June 2, 2024

I made it work by adding this to nginx config

server {
    #...

    proxy_set_header Host $http_host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

    #...
}

Thanks

from apepubsub.

lcharette avatar lcharette commented on June 2, 2024

If you want to proxy ape on port 80 (or any one), you an also have a look at HaProxy which support websocket. There's a guide on the ape-server main wiki on GitHub.

Envoyé de mon iPhone

Le 2014-06-09 à 10:01, moldcraft [email protected] a écrit :

I made it to work by adding this to nginx config

server {
#...

proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

#...

}
and using transport: 'lp' (ws does not work now, but its ok)


Reply to this email directly or view it on GitHub.

from apepubsub.

ptejada avatar ptejada commented on June 2, 2024

My host also proxies all my applications through and nginx front end server which also provides shared SSL. The websocket does work but not with the secure flag on. My guess is due to the shared SSL certificate.

Do you have a dedicated SSL certificate for your domain?

from apepubsub.

 avatar commented on June 2, 2024

I generated a wildcard certificate (not bought), and added it to trusted certificates to Chrome.

The first page opens with warning that this certificate is untrusted, but I click "Allow" and on next page refresh it's not bothering me. This happens because my certificate is only for subdomains *.mydomain.dev , but not for mydomain.dev. I tried, but without success, to add to certificate SAN mydomain.dev

All subdomains works well and does not give warnings. So I set APE on {number}.mydomain.dev. For *.ape.mydomain.dev it doesn't work.

from apepubsub.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.