<commit_before># wildfly-10-websockets
Prototype of a websocket async push implementation

## Browser support for websockets
[Browser Support](http://caniuse.com/#search=websockets)

## Details
The prototype is a JavaEE 7 app that builds as a war file and can be deployed to wildfly 10. To build the app you need maven installed and run the command "mvn clean package". Copy the war file to wildfly 10. It also requires a JMS topic "public.event" to be available on wildfly.

## Steps

To test the app after deployment, enter the home url and follow the steps below

### Step 1
Click on send message

This sends a message from the browser to the server. The server responds with "subscriber id" . The subscriber id is then used by the javascript on the page to open a websocket connection and wait for messages from the server.

![Step 1](step1.png =450x)

### Step 2
Copy the subscriber id

You will need this id to simulate async messages from the server to the client.

![Step2](step2.png =450x)

### Step 3
Post a message using curl or python to simulate server response

example code
```python
subscriberId = "1587e5cd-89a5-4f7c-bf5e-4271db0ffdbc"
payload = "Websocket Message 2"
headers = {"content-type": "text/plain"}
r = requests.post("http://localhost:9080/async-push/rest/push-msg/"+subscriberId, data=payload, headers=headers)
```

### Step 4

![Step 4](step4.png =450x)

<commit_msg>readme fixing image sizes<commit_after># wildfly-10-websockets
Prototype of a websocket async push implementation

## Browser support for websockets
[Browser Support](http://caniuse.com/#search=websockets)

## Details
The prototype is a JavaEE 7 app that builds as a war file and can be deployed to wildfly 10. To build the app you need maven installed and run the command "mvn clean package". Copy the war file to wildfly 10. It also requires a JMS topic "public.event" to be available on wildfly.

## Steps

To test the app after deployment, enter the home url and follow the steps below

### Step 1
Click on send message

This sends a message from the browser to the server. The server responds with "subscriber id" . The subscriber id is then used by the javascript on the page to open a websocket connection and wait for messages from the server.

<img src="step1.png" alt="Step1" style="width: 450px;">

### Step 2
Copy the subscriber id

You will need this id to simulate async messages from the server to the client.

<img src="step2.png" alt="Step2" style="width: 450px;">

### Step 3
Post a message using curl or python to simulate server response

example code
```python
subscriberId = "1587e5cd-89a5-4f7c-bf5e-4271db0ffdbc"
payload = "Websocket Message 2"
headers = {"content-type": "text/plain"}
r = requests.post("http://localhost:9080/async-push/rest/push-msg/"+subscriberId, data=payload, headers=headers)
```

### Step 4

<img src="step4.png" alt="Step4" style="width: 450px;">


{'fraction_non_alphanumeric': 0.08955739972337483, 'fraction_numerical': 0.03250345781466114, 'mean_word_length': 4.595744680851064, 'pattern_counts': {'":': 2, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6899891', 'n_tokens_mistral': 916, 'n_tokens_neox': 836, 'n_words': 394}