const port = 443
SSLApp( {} )
.addServerName( 'page1.com', {
key_file_name : 'page1.com/key.pem',
cert_file_name : 'page1.com/cert.pem',
} )
.addServerName( 'page2.com', {
key_file_name : 'page2.com/key.pem',
cert_file_name : 'page2.com/cert.pem',
} )
.missingServerName( ( hostname ) => {
console.log( 'Hello! We are missing server name <' + hostname + '>' )
} )
.get( '/*', ( res, req ) => {
res.end( 'Hello World!' )
} )
.listen( port, ( token ) => {
if ( token ) {
console.log( 'Listening to port ' + port )
} else {
console.log( 'Failed to listen to port ' + port )
}
} )
This code works with v20.10.0 fails with v20.15.0 and v20.19.0
It's may be caused due to 'Improved SNI support' in uWebSockets v20.18.0 which does not look to be implemented.