Skip to content

nim.pass_through_proxy.NIMPassThroughProxy

Zvicii edited this page Jul 11, 2022 · 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


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


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


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


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


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


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


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


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


removeAllListeners

removeAllListeners(event?): NIMPassThroughProxy

Remove all listeners, or those of the specified event.

Parameters

Name Type
event? "receiveHttpMsg"

Returns

NIMPassThroughProxy

Inherited from

EventEmitter.removeAllListeners


initEventHandlers

initEventHandlers(): void

注册全局回调

Returns

void


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 SendHttpRequestCallback 发送请求后的数据回调函数

Returns

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

void 无返回值

Properties

proxy

proxy: NIMPassThroughProxyAPI

Defined in

ts/nim/pass_through_proxy.ts:12

Constructors

constructor

new NIMPassThroughProxy()

Overrides

EventEmitter<NIMPassThroughProxyEvents&gt;.constructor

Clone this wiki locally