https://github.com/ging-dev/ratchet-heroku
Ratchet Socket Server for Heroku
https://github.com/ging-dev/ratchet-heroku
heroku php socket
Last synced: 4 months ago
JSON representation
Ratchet Socket Server for Heroku
- Host: GitHub
- URL: https://github.com/ging-dev/ratchet-heroku
- Owner: ging-dev
- License: mit
- Created: 2021-01-11T04:44:42.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-01-15T03:21:59.000Z (over 4 years ago)
- Last Synced: 2025-01-13T14:19:16.956Z (6 months ago)
- Topics: heroku, php, socket
- Language: JavaScript
- Homepage:
- Size: 15.6 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Ratchet Heroku
Ratchet Socket Server for Heroku[](https://github.styleci.io/repos/328550873?branch=master)
## Deploy
[](https://heroku.com/deploy?template=https://github.com/ging-dev/ratchet-heroku)
## Example
```javascript
// Then some JavaScript in the browser:
var conn = new WebSocket('wss://yourapp.herokuapp.com/echo');
conn.onmessage = function(e) { console.log(e.data); };
conn.onopen = function(e) { conn.send('Hello Me!'); };
```For autobahn.js
```javascript
var conn = new ab.Session('wss://yourapp.herokuapp.com/wamp',// WAMP session was established
function() {// subscribe to topic
conn.subscribe('test',// on event publication callback
function(topic, event) {
console.log('got event1');
console.log(event);
}
);
conn.publish('test', {
a: 23,
b: 'foobar'
});
},// WAMP session is gone
function() {
},
{'skipSubprotocolCheck': true}
);
```