Skip to content

Commit

Permalink
fix: resolve crypto-websocket error (#668)
Browse files Browse the repository at this point in the history
  • Loading branch information
KhudaDad414 committed Jan 3, 2024
1 parent 88f3e0c commit 88ae0e8
Show file tree
Hide file tree
Showing 10 changed files with 211 additions and 58 deletions.
10 changes: 5 additions & 5 deletions examples/crypto-websockets/client/asyncapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ servers:
- $ref: '#/components/securitySchemes/apiKey'
- $ref: '#/components/securitySchemes/cert'
channels:
/price:
price:
address: /price
messages:
index.message:
indexGraph:
$ref: '#/components/messages/indexGraph'
bindings:
ws:
Expand All @@ -27,9 +27,9 @@ operations:
index:
action: receive
channel:
$ref: '#/channels/~1price'
$ref: '#/channels/price'
messages:
- $ref: '#/components/messages/indexGraph'
- $ref: '#/channels/price/messages/indexGraph'
components:
messages:
indexGraph:
Expand Down Expand Up @@ -57,4 +57,4 @@ components:
type: apiKey
in: user
x-remoteServers:
- websockets
- websockets
2 changes: 1 addition & 1 deletion examples/crypto-websockets/client/db.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"time":1692154441640,"price":130,"status":"started"},{"time":1692154442650,"price":140,"status":"intransit"},{"time":1692154442650,"price":140,"status":"intransit"},{"time":1692154443663,"price":180,"status":"intransit"},{"time":1692154443663,"price":180,"status":"intransit"},{"time":1692154444668,"price":180,"status":"intransit"},{"time":1692154444668,"price":180,"status":"intransit"},{"time":1692154445678,"price":160,"status":"intransit"},{"time":1692154445678,"price":160,"status":"intransit"},{"time":1692154446687,"price":120,"status":"intransit"},{"time":1692154446687,"price":120,"status":"intransit"},{"time":1692154447695,"price":110,"status":"intransit"},{"time":1692154447695,"price":110,"status":"intransit"},{"time":1692154448703,"price":130,"status":"intransit"},{"time":1692154448703,"price":130,"status":"intransit"},{"time":1692154449713,"price":130,"status":"intransit"},{"time":1692154449713,"price":130,"status":"intransit"}]
[{"time":1704277182766,"price":140,"status":"started"},{"time":1704277183789,"price":150,"status":"intransit"},{"time":1704277183789,"price":150,"status":"intransit"},{"time":1704277184806,"price":180,"status":"intransit"},{"time":1704277184806,"price":180,"status":"intransit"},{"time":1704277185818,"price":210,"status":"intransit"},{"time":1704277185818,"price":210,"status":"intransit"},{"time":1704277186829,"price":220,"status":"intransit"},{"time":1704277186829,"price":220,"status":"intransit"},{"time":1704277187841,"price":260,"status":"intransit"},{"time":1704277187841,"price":260,"status":"intransit"},{"time":1704277188845,"price":250,"status":"intransit"},{"time":1704277188845,"price":250,"status":"intransit"},{"time":1704277189858,"price":290,"status":"intransit"},{"time":1704277189858,"price":290,"status":"intransit"},{"time":1704277190860,"price":310,"status":"intransit"},{"time":1704277190860,"price":310,"status":"intransit"}]
38 changes: 19 additions & 19 deletions examples/crypto-websockets/client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions examples/crypto-websockets/server/asyncapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ servers:
host: 'localhost:4000'
protocol: ws
channels:
/price:
price:
address: /price
messages:
subscribe.message:
indexGraph:
$ref: '#/components/messages/indexGraph'
bindings:
ws:
Expand All @@ -35,9 +35,9 @@ operations:
/price.subscribe:
action: send
channel:
$ref: '#/channels/~1price'
$ref: '#/channels/price'
messages:
- $ref: '#/components/messages/indexGraph'
- $ref: '#/channels/price/messages/indexGraph'
components:
messages:
indexGraph:
Expand All @@ -64,4 +64,4 @@ components:
in: header
cert:
type: apiKey
in: user
in: user
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default async function ({ glee, connection }) {
const date = new Date()
setTimeout(() => {
glee.send(new Message({
channel: '/price',
channel: 'price',
connection,
payload: {time: date.getTime(), price: getPrice(), status}
}))
Expand Down
Loading

0 comments on commit 88ae0e8

Please sign in to comment.