You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to update a project from mosca to aedes using typescript. When creating the server with the tsl module I'm getting:
"Argument of type '(stream: Connection, request: IncomingMessage) => Client' is not assignable to parameter of type '(socket: TLSSocket) => void'."
As mentioned in #487 it seems there is a type mismatch in the tsl module with the one in Aedes.d.ts. I've seen there are workarounds using a websocket server but I don't need it. Any idea how solve it? or what I'm getting wrong ?
import fs from 'node:fs';
import * as tls from 'node:tls';
import { Aedes } from 'aedes';
const aedes: Aedes = new Aedes();
const env = process.env.NODE_ENV || 'development';
const ascoltatoriConfig = domain.config.get('ascoltatori');
process.on('uncaughtException', function (err) {
process.exit(1);
});
// TLS/SSL
const SECURE_CERT =config.ssl_cert_path
const SECURE_KEY =config.ssl_key_path
const options = {
key: fs.readFileSync(SECURE_KEY),
cert: fs.readFileSync(SECURE_CERT)
}
const secureSettings = {
port: 2883,
secure: {
port: 9883,
keyPath: SECURE_KEY,
certPath: SECURE_CERT
},
allowNonSecure: true,
stats: false
};
domain.on('ready', function () {
// global.server = new mosca.Server(secureSettings); //previous mosca implementation
global.server = tls.createServer(options, aedes.handle) // Wasn't able to use aedes.handle as the secureConnectionListener param as the documentation mentions
})
The text was updated successfully, but these errors were encountered:
@Gianluca-Casagrande-Stiga When I do a default import it doesn't let me import the methods from aedes, the only way I've find its been instantiating it
I'm trying to update a project from mosca to aedes using typescript. When creating the server with the
tsl
module I'm getting:"Argument of type '(stream: Connection, request: IncomingMessage) => Client' is not assignable to parameter of type '(socket: TLSSocket) => void'."
As mentioned in #487 it seems there is a type mismatch in the
tsl
module with the one inAedes.d.ts
. I've seen there are workarounds using a websocket server but I don't need it. Any idea how solve it? or what I'm getting wrong ?The text was updated successfully, but these errors were encountered: