tlsd 2.18.0 → 2.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/tlsd.js +12 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tlsd",
3
- "version": "2.18.0",
3
+ "version": "2.19.0",
4
4
  "description": "A server for web app prototyping with HTTPS and Websockets",
5
5
  "main": "tlsd.js",
6
6
  "bin": {
package/tlsd.js CHANGED
@@ -184,7 +184,7 @@ function make_cookie_setters( res ) {
184
184
  // 4) Falls back to legacy directory loader at "root/rpc"
185
185
  // If loading succeeds, passes the message to the handler.
186
186
  // context may be one of:
187
- // { transport_type: "WS", connection: { ... } }
187
+ // { transport_type: "WS", connection: { name, socket, send, cookies, resource }, ... }
188
188
  // { transport_type: "GET", connection: { req, res } }
189
189
  // { transport_type: "POST", connection: { req, res } }
190
190
  // Additionally, context.upload_dir is set to the server's upload directory.
@@ -278,7 +278,15 @@ function ws_msg_handler( root, msg, host, connection ) {
278
278
  const { setCookie, clearCookie } = make_cookie_setters();
279
279
  const cookies = connection.cookies || {};
280
280
 
281
- rpc_handler( root, msg.msg, { transport_type: "WS", host, connection, cookies, setCookie, clearCookie }, data => {
281
+ rpc_handler( root, msg.msg, {
282
+ transport_type: "WS",
283
+ host,
284
+ connection,
285
+ cookies,
286
+ setCookie,
287
+ clearCookie,
288
+ dev_mode,
289
+ }, data => {
282
290
  msg.reply( data );
283
291
  }, err => {
284
292
  msg.error( err || "Unspecified Error" );
@@ -496,6 +504,7 @@ function rpc_post( root ) {
496
504
  cookies,
497
505
  setCookie,
498
506
  clearCookie,
507
+ dev_mode,
499
508
  } , output => {
500
509
  res.writeHead( 200, {
501
510
  "Content-Type": "application/json",
@@ -786,7 +795,7 @@ function ws_attach( server, msg_handler ) {
786
795
  socket.send( o2j( msg ) );
787
796
  };
788
797
 
789
- const conn = { name, socket, send, cookies };
798
+ const conn = { name, socket, send, cookies, resource: wsreq.resource };
790
799
 
791
800
  socket.on( "error", function( err ) {
792
801
  E( "WS: error", err.stack || err );