https://github.com/hassantauqeer/react-crossbar
This repo shows how to connect crossbar.io with ReactJS product.
https://github.com/hassantauqeer/react-crossbar
autobahn crossbar react reactjs sockets
Last synced: 21 days ago
JSON representation
This repo shows how to connect crossbar.io with ReactJS product.
- Host: GitHub
- URL: https://github.com/hassantauqeer/react-crossbar
- Owner: hassantauqeer
- License: mit
- Created: 2017-10-21T13:24:15.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-10-23T14:16:06.000Z (over 7 years ago)
- Last Synced: 2025-04-13T12:12:17.250Z (21 days ago)
- Topics: autobahn, crossbar, react, reactjs, sockets
- Language: JavaScript
- Homepage:
- Size: 3.97 MB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: Changelog.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
![]()
![]()
Start your next project with react-boilerplate and crossbarReact-boilerplate doesn't need any introduction credit goes to mxstbr, this repo is to describe implementation of crossbar in react-boilerplate## Crossbar Implementation
```bash
npm install --save autobahn-react
``````js
browserInitialize: function browserInitialize(port, path, realm) {
return this.initialize('ws://' + document.location.hostname + ':' + port + '/' + path, realm);
```
change this line
```bash
return this.initialize('ws://' + document.location.hostname + ':' + port + '/' + path, realm);
```
with your crossbar (localhoat)```bash
return this.initialize('ws://localhost:' + port + '/' + path, realm);
```
1. then go to app.js in app
2. Import Autobahn
3. Create connection & dispatch the connected event(Autobahn Object) to App(Main) Store
4. Then use that dispatched Autobahn Object wherever you want to subscribe in app like i did in HomePage container## Collaborations
A little work by me to help others, although there will be plenty of mistakes, thats why collaborations are highly Welcome. Thanks!