Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Pusher sample for Google App Engine

This sample demonstrates how to use the Pusher on Google App Engine. Pusher enables you to create public / private channels with presence information for real time messaging. This application demonstrates presence channels in Pusher using chat rooms. All users joining the chat room are authenticated using the /authorize endpoint. All users currently in the chat room receive updates of users joining / leaving the room. Java HTTP library is used for publishing messages to the channel and the JS Websocket library is used for subscribing.

Setup

Install the Google Cloud SDK and run:

   gcloud init

If this is your first time creating an App engine application:

   gcloud app create

Setup Pusher

  • Create a Pusher application and note down the app_id, app_key, app_secret and the cluster.
  • Update appengine-web.xml with these credentials.

Running locally

   mvn clean appengine:run

Access http://localhost:8080 via the browser, login and join the chat room. The chat window will contain a link you can use to join the room as a different user in another browser. You should now be able to view both the users within the chat application window and send messages to one another.

Deploying

  • Deploy the application to the project
         mvn clean appengine:deploy
        
    
    Access https://YOUR_PROJECT_ID.appspot.com