Skip to content

Vite for Gradleopensavvy.gradle.vite.base.configProxyOptions

ProxyOptions

data class ProxyOptions(val url: String, val target: String, val changeOrigin: Boolean, val ws: Boolean, val replacePrefixBy: String?) : Serializable

Configures the proxies started by the Vite development server.

Example

vite {
    server {
        proxy("/foo", "http://localhost:4567")
    }
}

External resources

See also

Constructors

ProxyOptions

constructor(url: String, target: String, changeOrigin: Boolean, ws: Boolean, replacePrefixBy: String?)

Properties

changeOrigin

Changes the origin of the host header to the target URL.

replacePrefixBy

A path section that replaces the captured url.

target

val target: String

The URL that the proxy should redirect to.

url

val url: String

The path that should be intercepted by the proxy.

ws

val ws: Boolean

true to proxy WebSockets.