Comments (5)
You have to bind aedes to wss, not a new tcp server.
var http = require('http')
var websocket = require('websocket-stream')
var RedisPersistence = require('aedes-persistence-redis')()
var aedes = require('aedes')({
concurrency: 1000,
persistence : RedisPersistence
})
var httpServ = http.createServer()
var port = 1884
var wss = websocket.createServer({server: httpServ, port: port}, aedes.handle)
This should work
from aedes.
This is not in the scope of this project, and it will be integrated with Mosca soon. You can achieve the same thing by using http://npm.im/websocket-stream.
from aedes.
I am sending my client side packet using mows.js and I am trying to pass the incoming stream to aedes using websocket-stream . Here is my code snippet
var http = require('http')
var websocket = require('websocket-stream')
var RedisPersistence = require('aedes-persistence-redis')()
var aedes = require('aedes')({
concurrency: 1000,
persistence : RedisPersistence
})
var httpServ = http.createServer()
var wss = websocket.createServer({server: httpServ},handle)
function handle(stream){
stream.pipe(server)
}
var server = require('net').createServer(aedes.handle)
var port = 1884
httpServ.listen(port, function (req,res) {
console.log('server listening on port', port)
})
from aedes.
@alliv8 explained it perfectly.
from aedes.
Got a clear idea , Thanks @alliv8 .
from aedes.
Related Issues (20)
- Aedes handle, client not connected HOT 1
- Why is CONNACK returned before the end of on.connect HOT 2
- [question] Kotlin Android examples
- Difficult to use in ES6 module package. HOT 10
- [question] How to get client ip address in Websocket mode HOT 1
- [feat!]: change to named exports to enable monkey patching HOT 11
- [question] Parsing a packet that come from old mqtt client version HOT 5
- Can Aedes send webhooks? HOT 2
- [bug] - TypeError during aedes Module Initialization
- mqtt服务启动后无法打印内容 HOT 2
- [bug] Aedes is undefined in Typescript HOT 7
- [bug] duplicated closed clients HOT 1
- [bug]"done" is not a function
- [question] does the test "unsubscribe throws error" valid? HOT 3
- [question] Any way to add data to connect packet and authorize handler? HOT 2
- [question]Frequent service clientError Error: invalid status code: 12592 HOT 1
- [bug] Number of TCP Connections accepted on container is less than the one deployed in EC2 machine HOT 7
- [bug] console.error introduced in v0.51.0 HOT 1
- [bug] Not all messages are consumed when dedupe is enabled HOT 7
- [question] Can i modify the source code of aedes and use in my project? Please help me out if there are any restrictions ? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aedes.