MCPcopy
hub / github.com/nodejs/undici / connect

Function connect

lib/api/api-connect.js:90–110  ·  view source on GitHub ↗
(opts, callback)

Source from the content-addressed store, hash-verified

88}
89
90function connect (opts, callback) {
91 if (callback === undefined) {
92 return new Promise((resolve, reject) => {
93 connect.call(this, opts, (err, data) => {
94 return err ? reject(err) : resolve(data)
95 })
96 })
97 }
98
99 try {
100 const connectHandler = new ConnectHandler(opts, callback)
101 const connectOptions = { ...opts, method: 'CONNECT' }
102 this.dispatch(connectOptions, connectHandler)
103 } catch (err) {
104 if (typeof callback !== 'function') {
105 throw err
106 }
107 const opaque = opts?.opaque
108 queueMicrotask(() => callback(err, { opaque }))
109 }
110}
111
112module.exports = connect

Callers

nothing calls this directly

Calls 3

rejectFunction · 0.85
resolveFunction · 0.85
dispatchMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…