Class: JWProxy
@appium/base-driver.JWProxy
Table of contents
Constructors
Properties
- _activeRequests
- _downstreamProtocol
- _log
- base
- httpAgent
- httpsAgent
- port
- protocolConverter
- reqBasePath
- scheme
- server
- sessionId
- timeout
Accessors
Methods
- cancelActiveRequests
- command
- endpointRequiresSessionId
- getActiveRequestsCount
- getProtocolFromResBody
- getSessionIdFromUrl
- getUrlForProxy
- proxy
- proxyCommand
- proxyReqRes
- request
- requestToCommandName
Constructors
constructor
• new JWProxy(opts?
)
Parameters
Name | Type |
---|---|
opts |
Object |
Defined in
packages/base-driver/lib/jsonwp-proxy/proxy.js:53
Properties
_activeRequests
• _activeRequests: any
[]
Defined in
packages/base-driver/lib/jsonwp-proxy/proxy.js:70
packages/base-driver/lib/jsonwp-proxy/proxy.js:111
_downstreamProtocol
• _downstreamProtocol: any
Defined in
packages/base-driver/lib/jsonwp-proxy/proxy.js:71
packages/base-driver/lib/jsonwp-proxy/proxy.js:119
_log
• _log: any
Defined in
packages/base-driver/lib/jsonwp-proxy/proxy.js:80
base
• base: string
Defined in
packages/base-driver/lib/jsonwp-proxy/proxy.js:45
httpAgent
• httpAgent: Agent
Defined in
packages/base-driver/lib/jsonwp-proxy/proxy.js:77
httpsAgent
• httpsAgent: Agent
Defined in
packages/base-driver/lib/jsonwp-proxy/proxy.js:78
port
• port: number
Defined in
packages/base-driver/lib/jsonwp-proxy/proxy.js:43
protocolConverter
• protocolConverter: ProtocolConverter
Defined in
packages/base-driver/lib/jsonwp-proxy/proxy.js:79
reqBasePath
• reqBasePath: string
Defined in
packages/base-driver/lib/jsonwp-proxy/proxy.js:47
scheme
• scheme: string
Defined in
packages/base-driver/lib/jsonwp-proxy/proxy.js:39
server
• server: string
Defined in
packages/base-driver/lib/jsonwp-proxy/proxy.js:41
sessionId
• sessionId: null
| string
Defined in
packages/base-driver/lib/jsonwp-proxy/proxy.js:49
timeout
• timeout: number
Defined in
packages/base-driver/lib/jsonwp-proxy/proxy.js:51
Accessors
downstreamProtocol
• get
downstreamProtocol(): any
Returns
any
Defined in
packages/base-driver/lib/jsonwp-proxy/proxy.js:123
• set
downstreamProtocol(value
): void
Parameters
Name | Type |
---|---|
value |
any |
Returns
void
Defined in
packages/base-driver/lib/jsonwp-proxy/proxy.js:118
log
• get
log(): any
Returns
any
Defined in
packages/base-driver/lib/jsonwp-proxy/proxy.js:83
Methods
cancelActiveRequests
▸ cancelActiveRequests(): void
Returns
void
Defined in
packages/base-driver/lib/jsonwp-proxy/proxy.js:110
command
▸ command(url
, method
, body?
): Promise
<any
>
Parameters
Name | Type | Default value |
---|---|---|
url |
any |
undefined |
method |
any |
undefined |
body |
null |
null |
Returns
Promise
<any
>
Defined in
packages/base-driver/lib/jsonwp-proxy/proxy.js:333
endpointRequiresSessionId
▸ endpointRequiresSessionId(endpoint
): boolean
Parameters
Name | Type |
---|---|
endpoint |
any |
Returns
boolean
Defined in
packages/base-driver/lib/jsonwp-proxy/proxy.js:114
getActiveRequestsCount
▸ getActiveRequestsCount(): number
Returns
number
Defined in
packages/base-driver/lib/jsonwp-proxy/proxy.js:106
getProtocolFromResBody
▸ getProtocolFromResBody(resObj
): undefined
| string
Parameters
Name | Type |
---|---|
resObj |
any |
Returns
undefined
| string
Defined in
packages/base-driver/lib/jsonwp-proxy/proxy.js:284
getSessionIdFromUrl
▸ getSessionIdFromUrl(url
): any
Parameters
Name | Type |
---|---|
url |
any |
Returns
any
Defined in
packages/base-driver/lib/jsonwp-proxy/proxy.js:385
getUrlForProxy
▸ getUrlForProxy(url
): string
Parameters
Name | Type |
---|---|
url |
any |
Returns
string
Defined in
packages/base-driver/lib/jsonwp-proxy/proxy.js:127
proxy
▸ proxy(url
, method
, body?
): Promise
<any
[]>
Parameters
Name | Type | Default value |
---|---|---|
url |
any |
undefined |
method |
any |
undefined |
body |
null |
null |
Returns
Promise
<any
[]>
Defined in
packages/base-driver/lib/jsonwp-proxy/proxy.js:185
proxyCommand
▸ proxyCommand(url
, method
, body?
): Promise
<any
>
Parameters
Name | Type | Default value |
---|---|---|
url |
any |
undefined |
method |
any |
undefined |
body |
null |
null |
Returns
Promise
<any
>
Defined in
packages/base-driver/lib/jsonwp-proxy/proxy.js:323
proxyReqRes
▸ proxyReqRes(req
, res
): Promise
<void
>
Parameters
Name | Type |
---|---|
req |
any |
res |
any |
Returns
Promise
<void
>
Defined in
packages/base-driver/lib/jsonwp-proxy/proxy.js:390
request
▸ Private
request(requestConfig
): Promise
<AxiosResponse
<any
, any
>>
Performs requests to the downstream server
- Do not call this method directly, it uses client-specific arguments and responses!
Parameters
Name | Type |
---|---|
requestConfig |
RawAxiosRequestConfig <any > |
Returns
Promise
<AxiosResponse
<any
, any
>>
Defined in
packages/base-driver/lib/jsonwp-proxy/proxy.js:96
requestToCommandName
▸ requestToCommandName(url
, method
): undefined
| string
Parameters
Name | Type |
---|---|
url |
string |
method |
HTTPMethod |
Returns
undefined
| string