mirror of
https://github.com/status-im/react-native.git
synced 2025-01-09 17:15:54 +00:00
655fe2796a
Summary: Implements a multi-device proxy for the Chrome debugging protocol. Each device connects to the proxy over a single websocket connection that is able to multiplex messages to multiple Javascript VMs. An inspector instance running in Chrome can connect to a specific VM via this proxy. Reviewed By: davidaurelio Differential Revision: D4088492 fbshipit-source-id: 3ee934e98604b5a378da732e687ca05fe3d23ce0
20 lines
531 B
JavaScript
20 lines
531 B
JavaScript
/**
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*/
|
|
'use strict';
|
|
|
|
module.exports = (url, middleware) => {
|
|
return (req, res, next) => {
|
|
if (req.url === url || req.url.startsWith(url + '/')) {
|
|
middleware(req, res, next);
|
|
} else {
|
|
next();
|
|
}
|
|
};
|
|
};
|