Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

lws

Package Overview
Dependencies
Maintainers
1
Versions
82
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lws - npm Package Compare versions

Comparing version 1.0.0-pre4.0 to 1.0.0

lib/middleware-base.js

12

lib/lws.js

@@ -119,3 +119,3 @@ /**

} else if (options.server) {
ServerFactory = loadModule(options.server)(ServerFactory)
ServerFactory = loadModule(options.server, options)(ServerFactory)
}

@@ -129,7 +129,13 @@ const factory = new ServerFactory()

const WebsocketBase = require('./websocket-base')
const wsModule = typeof options.websocket === 'string' ? loadModule(options.websocket) : options.websocket
const wsModule = typeof options.websocket === 'string' ? loadModule(options.websocket, options) : options.websocket
const WebsocketModule = wsModule(WebsocketBase)
const websocketModule = new WebsocketModule()
let wsOptions = { perMessageDeflate: false }
if (websocketModule.wsOptions) {
wsOptions = Object.assign({}, wsOptions, websocketModule.wsOptions())
}
const Websocket = require('ws')
const wss = new Websocket.Server({ server, perMessageDeflate: false })
this.emit('verbose', 'websocket.server.config', wsOptions)
wsOptions.server = server
const wss = new Websocket.Server(wsOptions)
this.propagate(websocketModule)

@@ -136,0 +142,0 @@ let webSocketId = 1

'use strict'
const flatten = require('reduce-flatten')
const EventEmitter = require('events')
const MiddlewareBase = require('./middleware-base')

@@ -39,3 +40,2 @@ /**

loadMiddlewareModules(mwModules, options)
const MiddlewareBase = require('./middleware')
const stack = this.from(mwModules.map(mwModule => {

@@ -60,6 +60,5 @@ const Middleware = mwModule(MiddlewareBase)

function loadMiddlewareModules (MwModules, options) {
const Middleware = require('./middleware')
MwModules.forEach((MwModule, index) => {
if (typeof MwModule === 'string') {
MwModules[index] = Middleware.load(MwModule, options)
MwModules[index] = MiddlewareBase.load(MwModule, options)
}

@@ -66,0 +65,0 @@ })

{
"name": "lws",
"author": "Lloyd Brookes <75pound@gmail.com>",
"version": "1.0.0-pre4.0",
"version": "1.0.0",
"description": "The modular web server for productive full-stack development",

@@ -6,0 +6,0 @@ "repository": "https://github.com/lwsjs/lws.git",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc