Skip to content

Commit

Permalink
Merge pull request #14 from composer22/feature/server
Browse files Browse the repository at this point in the history
Feature/server Cleanup
  • Loading branch information
composer22 committed May 4, 2015
2 parents e89d8d1 + fb036d6 commit 4b290ed
Show file tree
Hide file tree
Showing 15 changed files with 62 additions and 36 deletions.
29 changes: 26 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,30 @@ The socket connection endpoint is:
```
ws://{host:port}/v1.0/chat
```
Following are some examples for using Chrome/Dark Websocket.

The basic json format of a request is as follows:

```
{
"roomName":"Name of the room to access",
"reqType":999,
"content":"command, metadata, msg etc."
}
```

The basic json format of a response back from the server is as follows:

```
{
"roomName":"Name of the room responding.",
"rspType":999,
"content":"confirmation data, message, errors, etc"
"list":["data","in","array","form","such","as","roomnames"]
}
```
See server/chat_request.go and server/chat_response.go for more details on types.

The following are some examples for using Chrome/Dark Websocket.
Spaces must be encoded in JSON calls.

```
Expand Down Expand Up @@ -124,8 +147,8 @@ Spaces must be encoded in JSON calls.
```

A client javascript/html demo is provided under the /client directory.
Please see that directories README.md for more information.
Clientside demos are provided under the /client directory.
Please see those directory README.md files for more information.

## HTTP API for Alive and Stats

Expand Down
35 changes: 2 additions & 33 deletions client/README.md
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,34 +1,3 @@
## ChattyPantz Client Demo
## ChattyPantz Client Demos

This folder contains a simple demonstration of a client connection to the server using javascript and html.

### Dependencies

* You must be connected to the internet to load CDN angular.js, semnatic-ui.js, and jquery.js.
* The server should be running on localhost:6660

### Instructions

Assumption: server is up and running on localhost:6660.

If needed, you can change the API host and port endpoint in scripts/services/api.js:
```
var server = "ws://127.0.0.1:6660/v1.0/chat";
```
1. Load app/index.html in your browser.
2. Enter a nickname.
3. Connect to the server.

You will be placed into room "Demo". A list of user nicknames from the room will also be displayed.
NOTE: If your nickname already exists when logging into the room, you will be warned and disconnected.

4. Now, send your messages.
5. When you are done, disconnect from the server.

### Enhancements

The application doesn't demonstrate multi-room management, nor does it demonstrate the following request types:
* GET_NICKNAME: 102
* LIST_ROOMS: 103
* HIDE: 106
* UNHIDE: 107
Subfolders in this directory demonstrate client side connections to the Chattypantz server.
34 changes: 34 additions & 0 deletions client/angular/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
## ChattyPantz Client Demo - Angular.js

This folder contains a simple demonstration of a client connection to the server using javascript and html.

### Dependencies

* You must be connected to the internet to load CDN angular.js, semnatic-ui.js, and jquery.js.
* The server should be running on localhost:6660

### Instructions

Assumption: server is up and running on localhost:6660.

If needed, you can change the API host and port endpoint in scripts/services/api.js:
```
var server = "ws://127.0.0.1:6660/v1.0/chat";
```
1. Load app/index.html in your browser.
2. Enter a nickname.
3. Connect to the server.

You will be placed into room "Demo". A list of user nicknames from the room will also be displayed.
NOTE: If your nickname already exists when logging into the room, you will be warned and disconnected.

4. Now, send your messages.
5. When you are done, disconnect from the server.

### Enhancements

The application doesn't demonstrate multi-room management, nor does it demonstrate the following request types:
* GET_NICKNAME: 102
* LIST_ROOMS: 103
* HIDE: 106
* UNHIDE: 107
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 4b290ed

Please sign in to comment.