appium-jsonwp-proxy
Proxy middleware for the Selenium JSON Wire Protocol. Allows
Usage
The proxy is used by instantiating with the details of the Selenium server to which to proxy. The options for the constructor are passed as a hash with the following possible member:
scheme
- defaults to 'http'server
- defaults to 'localhost'port
- defaults to4444
base
- defaults to '/wd/hub'sessionId
- the session id of the session on the remote server
Once the proxy is created, there are two async
methods:
command (url, method, body)
Sends a "command" to the proxied server, using the "url", which is the endpoing, with the HTTP method and optional body.
; let host = 'my.host.com';let port = 4445; let proxy = server: host port: port; // get the Selenium server statuslet seStatus = await proxy;
proxyReqRes (req, res)
Proxies a request and response to the proxied server. Used to handle the entire conversation of a request/response cycle.
;; let host = 'my.host.com';let port = 4445; let proxy = server: host port: port; http;