
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
@nuxt-alt/proxy
Advanced tools
Proxy module for Nuxt
This serves as an alternative for @nuxtjs-alt/proxy. Please note that this is for nuxt 3 only. The config is similar to what vite has except that this one creates a physical file which is needed for production.
@nuxt-alt/proxy
dependency to your projectyarn add @nuxt-alt/proxy
@nuxt-alt/proxy
to the modules
section of nuxt.config.ts
export default defineNuxtConfig({
modules: [
'@nuxt-alt/proxy'
],
proxy: {
/* module options */
}
});
proxies
Object
{}
debug
Boolean
false
(false in prod | true in dev)urls to proxy
experimental.listener
Boolean
false
Enable this to use a nitro plugin that tries to hook onto the server's request and grab the server to listen in production. This is untested in non-node environments.
Nitro hook available after enabling (only in production):
nitroApp.hooks.hook('listen:node', (server) => {})
import { defineNuxtConfig } from 'nuxt/config'
export default defineNuxtConfig({
modules: [
'@nuxt-alt/proxy',
],
proxy: {
debug: false,
experimental: {
listener: false
},
proxies: {
// string shorthand
'/foo': 'http://localhost:4567',
// with options
'/api': {
target: 'http://jsonplaceholder.typicode.com',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, '')
},
// with RegEx
'^/fallback/.*': {
target: 'http://jsonplaceholder.typicode.com',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/fallback/, ''),
configure: (proxy, options, runtimeConfig) => {
// proxy will be an instance of 'http-proxy'
},
},
// Using the proxy instance
'/api': {
target: 'http://jsonplaceholder.typicode.com',
changeOrigin: true,
configureWithEvent: (proxy, options, runtimeConfig, event, h3) => {
// proxy will be an instance of 'http-proxy'
// event will be an instance of the matched url
proxy.on('proxyReq', (proxyReq) => {
const cookies = h3.parseCookies(event)
console.log(cookies)
})
}
},
// Proxying websockets or socket.io - Note this only works with `experimental.listener`
'/socket.io': {
target: 'ws://localhost:5173',
ws: true
}
}
}
})
FAQs
An alternative module to @nuxtjs/proxy
The npm package @nuxt-alt/proxy receives a total of 1,710 weekly downloads. As such, @nuxt-alt/proxy popularity was classified as popular.
We found that @nuxt-alt/proxy demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.