anchor.diff: -
  - = Using Web Sockets
  += Using Web Sockets
   
   This guide explains how your Shamrock application can utilize web sockets to create interactive web applications.
   Because it's the _canonical_ web socket application, we are going to create a simple chat application.
  
positive.code: 
  == A slick web frontend
  
  All chat applications need a _nice_ UI, well this one may not be that nice, but should do the work.
  The first things to do is to configure our application to serve static resources.
  Edit the `HelloResource.java` file and add the following method:
  
  [source,java]
  ----
  @GET
  @Path("/assets/{path: .*}")
  public Response staticResources(@PathParam("path") final String path) {
      InputStream resource = HelloResource.class.getClassLoader().getResourceAsStream("/assets/" + path);
      return resource == null ? Response.status(404).build() : Response.ok().entity(resource).build();
  }
  ----
  
  This method serves any files located into the `assets` directory.
  
  Now, create the `assets` directory in `src/main/resources` and, in this newly created directory, copy this https://github.com/protean-project/quickstarts/blob/master/using-websockets/src/main/resources/assets/index.html[index.html] file.
  
  == Run the application
  
  Now, let's see our application in action. Run it with:
  
  ```
  mvn compile shamrock:run
  ```
  
  Then open your 2 browser windows to http://localhost:8080/app/hello/assets/index.html:
  
  1. Enter a name in the top text area (use 2 different names).
  2. Click on connect
  
negative.code: 
  Clone the Git repository: `git clone https://github.com/protean-project/quickstarts.git`, or download an https://github.com/protean-project/quickstarts/archive/master.zip[archive].
  
  The solution is located in the `using-websockets` https://github.com/protean-project/quickstarts/tree/master/using-websockets[directory].
  
  == Creating the Maven project
  
  