idoco / map-chat

A super simple location based chat
http://idoco.github.io/map-chat
676 stars 94 forks source link

Failed to connect to a new server #37

Closed chioscio closed 8 years ago

chioscio commented 8 years ago

Hello idoco, thank you very much for the idea of chat map. I find it very beautiful and practical. I'm trying for this reason to implement it in my server, where I performed step by step instructions in the readme, and actually is the map that messages a ppear, but I do not see the blue dot position and I can not send messages. :( The server is: 79.40.202.175

Could you please help figure out if I'm wrong some step?!? Many thanks

screen shot 2016-05-05 at 23 54 24

idoco commented 8 years ago

Sure! If you can first try to connect to the server from its localhost and see if that works, the default configuration blocks all the communication coming from browser sessions in which the origin is not localhost (See this line)

I had to do that on my server to allow only sessions coming from http://idoco.github.io/map-chat because I had serious problem with small time hackers flooding the chat :smile:

The two ways to fix this issue are

  1. Replace the origin in the filter to be what you expect it to be.
  2. Remove the filtering completely by replacing this block with:
@Override
public boolean handleSocketCreated(SockJSSocket sock) {            
    return true;
}
chioscio commented 8 years ago

Hello idoco Thank you very much for the prompt response. And yes, these hackers :) I tried to change the line that you indicated to me, but as you will also see you, nothing :( I think it's due to the fact that the server is a small raspberry and probably the VertX technology is not very functional ... what do you think? Because I noticed that ipinfo.io respond but the map is not marked the point where I am ... Moreover tot seconds after the message 'connection lost, please refresh :(' I just know that it's me that I'm not able ...;) Your every other advice is welcome, to understand what it is I'm wrong ... Thanks for your help

idoco commented 8 years ago

It seems that vertx is working with Raspberry Pi - See here (although they are running vert.x3) They do mention that -

If the program blocks the event loop for more than 2 seconds, you have error messages, but the application continues to run (it's more like a warning). As the raspberry pi is not really fast it's likely to happen.

Can you please share the server logs an see if there are any errors in it? Can you add another log lines during the server startup and inside the handleSocketCreated function just to see that the server responds?

chioscio commented 8 years ago

idoco thank you for the advice. Yes, you're absolutely right! Raspberry uses version 3.2.1 of VertX. I to be in line with the instructions, I also installed the required version of MapChat, namely version 2.1.5. Of course! here's what to me appears after completing the server. screen shot 2016-05-12 at 00 52 44 As it will not give any error ... However if you like, I'll leave you my email for possibly hear in private, so I give you the server references and wishing we can fiddle around a bit to figure out how to go is wrong ... :(

I thank you for the help. My email: iz1gzc@virgilio.it

idoco commented 8 years ago

Thanks! I've sent you an email.

chioscio commented 8 years ago

Great idoco! Now thanks to your kindness and wisdom, it works perfectly on my small raspberry PI ;) screen shot 2016-05-15 at 23 44 51 God bless you Chioscio