Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

appium-jsonwp-proxy

Package Overview
Dependencies
Maintainers
7
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

appium-jsonwp-proxy

Reusable JSONWP Proxy

latest
Source
npmnpm
Version
1.5.0
Version published
Maintainers
7
Created
Source

appium-jsonwp-proxy

NPM version Downloads Dependency Status devDependency Status

Build Status Coverage Status

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 to 4444
  • 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.

import JWProxy from 'appium-jsonwp-proxy';

let host = 'my.host.com';
let port = 4445;

let proxy = new JWProxy({server: host, port: port});

// get the Selenium server status
let seStatus = await proxy.command('/status', 'GET');

proxyReqRes (req, res)

Proxies a request and response to the proxied server. Used to handle the entire conversation of a request/response cycle.

import JWProxy from 'appium-jsonwp-proxy';
import http from 'http';

let host = 'my.host.com';
let port = 4445;

let proxy = new JWProxy({server: host, port: port});


http.createServer(function (req, res) {
  await proxy.proxyReqRes(res, res);
}).listen(9615);

Keywords

appium

FAQs

Package last updated on 25 Jan 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts