Skip to content

nim.pass_through_proxy.NIMPassThroughProxy

Zvicii edited this page Feb 10, 2023 · 6 revisions

Class: NIMPassThroughProxy

nim/pass_through_proxy.NIMPassThroughProxy

Hierarchy

Table of contents

Methods

Properties

Constructors

Methods

eventNames

eventNames(): "receiveHttpMsg"[]

Return an array listing the events for which the emitter has registered listeners.

Returns

"receiveHttpMsg"[]

Inherited from

EventEmitter.eventNames

Defined in

node_modules/eventemitter3/index.d.ts:15


listeners

listeners<T>(event): (...args: ArgumentMap<NIMPassThroughProxyEvents>[Extract<T, "receiveHttpMsg">]) => void[]

Return the listeners registered for a given event.

Type parameters

Name Type
T extends "receiveHttpMsg"

Parameters

Name Type
event T

Returns

(...args: ArgumentMap<NIMPassThroughProxyEvents>[Extract<T, "receiveHttpMsg">]) => void[]

Inherited from

EventEmitter.listeners

Defined in

node_modules/eventemitter3/index.d.ts:20


listenerCount

listenerCount(event): number

Return the number of listeners listening to a given event.

Parameters

Name Type
event "receiveHttpMsg"

Returns

number

Inherited from

EventEmitter.listenerCount

Defined in

node_modules/eventemitter3/index.d.ts:27


emit

emit<T>(event, ...args): boolean

Calls each of the listeners registered for a given event.

Type parameters

Name Type
T extends "receiveHttpMsg"

Parameters

Name Type
event T
...args ArgumentMap<NIMPassThroughProxyEvents>[Extract<T, "receiveHttpMsg">]

Returns

boolean

Inherited from

EventEmitter.emit

Defined in

node_modules/eventemitter3/index.d.ts:32


on

on<T>(event, fn, context?): NIMPassThroughProxy

Add a listener for a given event.

Type parameters

Name Type
T extends "receiveHttpMsg"

Parameters

Name Type
event T
fn (...args: ArgumentMap<NIMPassThroughProxyEvents>[Extract<T, "receiveHttpMsg">]) => void
context? any

Returns

NIMPassThroughProxy

Inherited from

EventEmitter.on

Defined in

node_modules/eventemitter3/index.d.ts:40


addListener

addListener<T>(event, fn, context?): NIMPassThroughProxy

Type parameters

Name Type
T extends "receiveHttpMsg"

Parameters

Name Type
event T
fn (...args: ArgumentMap<NIMPassThroughProxyEvents>[Extract<T, "receiveHttpMsg">]) => void
context? any

Returns

NIMPassThroughProxy

Inherited from

EventEmitter.addListener

Defined in

node_modules/eventemitter3/index.d.ts:45


once

once<T>(event, fn, context?): NIMPassThroughProxy

Add a one-time listener for a given event.

Type parameters

Name Type
T extends "receiveHttpMsg"

Parameters

Name Type
event T
fn (...args: ArgumentMap<NIMPassThroughProxyEvents>[Extract<T, "receiveHttpMsg">]) => void
context? any

Returns

NIMPassThroughProxy

Inherited from

EventEmitter.once

Defined in

node_modules/eventemitter3/index.d.ts:54


removeListener

removeListener<T>(event, fn?, context?, once?): NIMPassThroughProxy

Remove the listeners of a given event.

Type parameters

Name Type
T extends "receiveHttpMsg"

Parameters

Name Type
event T
fn? (...args: ArgumentMap<NIMPassThroughProxyEvents>[Extract<T, "receiveHttpMsg">]) => void
context? any
once? boolean

Returns

NIMPassThroughProxy

Inherited from

EventEmitter.removeListener

Defined in

node_modules/eventemitter3/index.d.ts:63


off

off<T>(event, fn?, context?, once?): NIMPassThroughProxy

Type parameters

Name Type
T extends "receiveHttpMsg"

Parameters

Name Type
event T
fn? (...args: ArgumentMap<NIMPassThroughProxyEvents>[Extract<T, "receiveHttpMsg">]) => void
context? any
once? boolean

Returns

NIMPassThroughProxy

Inherited from

EventEmitter.off

Defined in

node_modules/eventemitter3/index.d.ts:69


removeAllListeners

removeAllListeners(event?): NIMPassThroughProxy

Remove all listeners, or those of the specified event.

Parameters

Name Type
event? "receiveHttpMsg"

Returns

NIMPassThroughProxy

Inherited from

EventEmitter.removeAllListeners

Defined in

node_modules/eventemitter3/index.d.ts:79


initEventHandlers

initEventHandlers(): void

注册全局回调

Returns

void

Defined in

ts/nim/pass_through_proxy.ts:19


sendHttpRequest

sendHttpRequest(host, path, method, headers, body, jsonExtension, cb): Promise<[NIMResCode, string, string, string]>

发送一个透传 HTTP 请求

Parameters

Name Type Description
host string 要发送的 HTTP 请求 Host 地址
path string URL 中除了 Host 的 Path
method NIMSendHttpRequestMethods 要发送的 HTTP 请求方式
headers string -
body string 要发送的 HTTP 请求 Body 内容
jsonExtension string 拓展字段,暂时无用
cb null | SendHttpRequestCallback 发送请求后的数据回调函数

Returns

Promise<[NIMResCode, string, string, string]>

void 无返回值

Defined in

ts/nim/pass_through_proxy.ts:33

Properties

proxy

proxy: NIMPassThroughProxyAPI

Defined in

ts/nim/pass_through_proxy.ts:12

Constructors

constructor

new NIMPassThroughProxy()

Overrides

EventEmitter<NIMPassThroughProxyEvents&gt;.constructor

Defined in

ts/nim/pass_through_proxy.ts:13

Clone this wiki locally