GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — java-docs-samples/appengine/pusher-chat at master · illyr/java-docs-samples

Expand file tree

/

pusher-chat

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
 
 
/

pusher-chat

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
src/main
src/main
 
 
README.md
README.md
 
 
pom.xml
pom.xml
 
 

README.md

Outline

Pusher sample for Google App Engine

Java 7 runtime support on App Engine standard was deprecated on December 13, 2017 and will be shut down entirely on January 16, 2019. It is replaced by the Java 8 Runtime Environment.

Open in Cloud Shell

Samples for the Java 8 runtime can be found here.

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
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.