Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ging-dev/ratchet-heroku
Ratchet Socket Server for Heroku
https://github.com/ging-dev/ratchet-heroku
heroku php socket
Last synced: 29 days 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 (about 4 years ago)
- Default Branch: master
- Last Pushed: 2021-01-15T03:21:59.000Z (about 4 years ago)
- Last Synced: 2024-11-14T00:28:45.640Z (3 months ago)
- Topics: heroku, php, socket
- Language: JavaScript
- Homepage:
- Size: 15.6 KB
- Stars: 2
- 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[![StyleCI](https://github.styleci.io/repos/328550873/shield?branch=master)](https://github.styleci.io/repos/328550873?branch=master)
![Made with love in Vietnam](https://madewithlove.now.sh/vn?heart=true)## Deploy
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](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}
);
```