bboyairwreck / PieMessage

This is project allows Android clients to communicate using iMessage
1.04k stars 166 forks source link

error message in piemessageosx client #16

Open telis11 opened 8 years ago

telis11 commented 8 years ago

i get the error message when i try to run the OS X client connection refused

zanesc commented 8 years ago

you need to forward port 5000 to your OS X machine through your firewall/router.

edit: you also need to forward port 4000 to your phone. edit: the above no longer works as of commit fec3bbfc5758f7422163c616fb3e3b841a903adc. I can send messages but no longer receive them.
atomheartbrother commented 8 years ago

How would you go about port forwarding on your phone? Would you need to start with a static IP address?

zanesc commented 8 years ago

same process as with computer, both of these are done through the router/firewall settings. set a static IP referencing the MAC address of the device then forward ports using those static IPs.

atomheartbrother commented 8 years ago

Okay thank you. This might be a stupid question but.. does this only work on wifi or also mobile networks

zanesc commented 8 years ago

haha, no not stupid. I had to test it myself to see if it worked or not as well. Once you use your global IP in the setup phase it works on wifi and mobile networks. but seeing as it is still in early stages of development i have seen a few missed messages while making the switch to a different network.

bboyairwreck commented 8 years ago

Yeah. PieMessage was the first time working with sockets. I haven't figured out how to fail gracefully when the socket is closed. I could reconnect but honestly, Google recommends AGAINST having a socket open in the background all the time. I only wanted to use my own socket because I didn't want any messages going through any kind of Google server just for realtime notifications just for privacy/security reasons.

spencerelliott commented 8 years ago

It would be awesome if the Java server on the Mac could use Google Cloud Messaging services (https://developers.google.com/cloud-messaging/). That should be extremely reliable and doesn't require you to keep a socket open forever. Plus, it'll work on WiFi and mobile networks. All you have to do is connect to the socket when the Android app is open and pull all new messages down.

This would require a bit more setup on the user's side, but I think messages would be a lot more reliable.