
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
@react-native/dev-middleware
Advanced tools
Dev server middleware supporting core React Native development features. This package is preconfigured in all React Native projects.
Middleware can be attached to a dev server (e.g. Metro) using the createDevMiddleware
API.
import { createDevMiddleware } from '@react-native/dev-middleware';
function myDevServerImpl(args) {
...
const {middleware, websocketEndpoints} = createDevMiddleware({
projectRoot: metroConfig.projectRoot,
serverBaseUrl: `http://${args.host}:${args.port}`,
logger,
});
await Metro.runServer(metroConfig, {
host: args.host,
...,
unstable_extraMiddleware: [
middleware,
// Optionally extend with additional HTTP middleware
],
websocketEndpoints: {
...websocketEndpoints,
// Optionally extend with additional WebSocket endpoints
},
});
}
@react-native/dev-middleware
is designed for integrators such as @expo/dev-server
and @react-native/community-cli-plugin
. It provides a common default implementation for core React Native dev server responsibilities.
We intend to keep this to a narrow set of functionality, based around:
DevMiddlewareAPI.middleware
These are exposed as a connect
middleware handler, assignable to Metro.runServer
or other compatible HTTP servers.
/json/list
, /json
(CDP)Returns the list of available WebSocket targets for all connected React Native app sessions.
/json/version
(CDP)Returns version metadata used by Chrome DevTools.
/debugger-frontend
Subpaths of this endpoint are reserved to serve the JavaScript debugger frontend.
/open-debugger
Open the JavaScript debugger for a given CDP target. Must be provided with one of the following query params:
device
— An ID unique to a combination of device and app, stable across installs. Implemented by getInspectorDeviceId
on each native platform.target
— The target page ID as returned by /json/list
for the current dev server session.appId
(deprecated, legacy only) — The application bundle identifier to match (non-unique across multiple connected devices). This param will only match legacy Hermes debugger targets.curl -X POST 'http://localhost:8081/open-debugger?target=<targetId>'
DevMiddlewareAPI.websocketEndpoints
/inspector/device
WebSocket handler for registering device connections.
/inspector/debug
WebSocket handler that proxies CDP messages to/from the corresponding device.
React Native frameworks may pass an unstable_experiments
option to createDevMiddleware
to configure experimental features. Note that these features might not work correctly, and they may change or be removed in the future without notice. Some of the experiment flags available are documented below.
unstable_experiments.enableStandaloneFuseboxShell
When true
, the debugger frontend will launch in a standalone app shell (provided by the @react-native/debugger-shell
package) rather than in a browser window. The standalone shell provides an improved experience and will become the default in a future version of React Native.
The shell is powered by a separate binary that is downloaded and cached in the background (immediately after the call to createDevMiddleware
). If there is a problem downloading or invoking this binary for the first time, the debugger frontend will revert to launching in a browser window until the next time createDevMiddleware
is called (typically, on the next dev server start).
Changes to this package can be made locally and tested against the rn-tester
app, per the Contributing guide. During development, this package is automatically run from source with no build step.
FAQs
Dev server middleware for React Native
The npm package @react-native/dev-middleware receives a total of 3,311,023 weekly downloads. As such, @react-native/dev-middleware popularity was classified as popular.
We found that @react-native/dev-middleware demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.