svrjs-nextjs-website/pages/docs/api/proxy-callback.md

94 lines
1.7 KiB
Markdown
Raw Normal View History

---
title: Proxy callback API (module.exports.proxy)
---
2024-09-06 19:36:08 +02:00
### Proxy callback API (`module.exports.proxy`)
2024-09-07 18:16:28 +02:00
<small>_Added in SVR.JS 4.0.0_</small>
2024-09-06 19:36:08 +02:00
#### _req_
2024-09-07 18:16:28 +02:00
<small>_Added in SVR.JS 4.0.0_</small>
2024-09-06 19:36:08 +02:00
_req_ object is the same, as _req_ object in Node.JS
#### _socket_
2024-09-07 18:16:28 +02:00
<small>_Added in SVR.JS 4.0.0_</small>
2024-09-06 19:36:08 +02:00
_socket_ object is the same, as _socket_ object in Node.JS
#### _head_
2024-09-07 18:16:28 +02:00
<small>_Added in SVR.JS 4.0.0_</small>
2024-09-06 19:36:08 +02:00
_head_ object is the same, as _head_ object in Node.JS
#### _logFacilities_
2024-09-07 18:16:28 +02:00
<small>_Added in SVR.JS 4.0.0_</small>
2024-09-06 19:36:08 +02:00
_See logFacilties in main callback API_
#### _config_
2024-09-07 18:16:28 +02:00
<small>_Added in SVR.JS 4.0.0_</small>
2024-09-06 19:36:08 +02:00
_See config in main callback API_
#### _next()_
2024-09-07 18:16:28 +02:00
<small>_Added in SVR.JS 4.0.0_</small>
2024-09-06 19:36:08 +02:00
_See next in main callback API_
### Global variables (for use in callback APIs)
#### _process.versions.svrjs_
2024-09-07 18:16:28 +02:00
<small>_Added in SVR.JS 4.0.0_</small>
2024-09-06 19:36:08 +02:00
A property containing SVR.JS version.
#### _process.serverConfiguration_
2024-09-07 18:16:28 +02:00
<small>_Added in SVR.JS 4.0.0_</small>
2024-09-06 19:36:08 +02:00
A property containing SVR.JS configuration from _config.json_ file.
#### _process.dirname_
2024-09-07 18:16:28 +02:00
<small>_Added in SVR.JS 4.0.0_</small>
2024-09-06 19:36:08 +02:00
A property containg the SVR.JS installation directory.
#### _process.filename_
2024-09-07 18:16:28 +02:00
<small>_Added in SVR.JS 4.0.0_</small>
2024-09-06 19:36:08 +02:00
A property containg the path to the SVR.JS script.
#### _process.err4xxcounter_
2024-09-07 18:16:28 +02:00
<small>_Added in SVR.JS 4.0.0_</small>
2024-09-06 19:36:08 +02:00
A property containg the count of 4xx HTTP errors.
#### _process.err5xxcounter_
2024-09-07 18:16:28 +02:00
<small>_Added in SVR.JS 4.0.0_</small>
2024-09-06 19:36:08 +02:00
A property containg the count of 5xx HTTP errors.
#### _process.reqcounter_
2024-09-07 18:16:28 +02:00
<small>_Added in SVR.JS 4.0.0_</small>
2024-09-06 19:36:08 +02:00
A property containg the count of HTTP requests.
#### _process.malformedcounter_
2024-09-07 18:16:28 +02:00
<small>_Added in SVR.JS 4.0.0_</small>
2024-09-06 19:36:08 +02:00
A property containg the count of malformed HTTP requests.