Skip to content

Commit

Permalink
Websocket endpoint conflict with connect endpoint
Browse files Browse the repository at this point in the history
The spec provides websocket endpoint that conflict with connect
API endpoint. Using `/ws` endpoint for websocket connect is a
better and suitable option.

Signed-off-by: Pradyumna Krishna <[email protected]>
  • Loading branch information
PradyumnaKrishna committed Aug 10, 2024
1 parent 3c0c41a commit 9da9eab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions SPECIFICATION.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Enigma Protocol Specification

**Date**: July 8, 2024
**Version**: 0.3.0
**Version**: 0.3.1

## Overview

Expand Down Expand Up @@ -53,7 +53,7 @@ The server must provide the following REST APIs:

The server must provide a WebSocket endpoint for users to connect and transmit messages.

`WebSocket /connect/{userId}`
`WebSocket /ws/{userId}`

- **Description**: Connect to the server to receive messages.
- **Request**:
Expand Down Expand Up @@ -93,7 +93,7 @@ The key exchange process involves the following steps:

### Message Transmission

1. Alice connects to the server using the `/connect` WebSocket endpoint.
1. Alice connects to the server using the `/ws` WebSocket endpoint.
2. Alice sends a message to Bob using the following JSON object:
```json
{
Expand Down
2 changes: 1 addition & 1 deletion src/components/Chat.vue
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ export default {
this.validateUser()
this.privateKey = Crypto.privateKeyFromBase64(this.$props.keypair.privateKey)
const socket = new WebSocket(`${this.wsURL}/connect/${this.$props.user}`)
const socket = new WebSocket(`${this.wsURL}/ws/${this.$props.user}`)
// retrieve users from localStorage
if (localStorage.getItem('users')) {
Expand Down

0 comments on commit 9da9eab

Please sign in to comment.