定制 uwebpro/scrapoxy-api 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

uwebpro/scrapoxy-api

Composer 安装命令:

composer require uwebpro/scrapoxy-api

包简介

PHP API Container for Scrapoxy Commander

README 文档

README

This package interacts with the API from scrapoxy via a straight-forward interface

Installing

$ composer require uwebpro/scrapoxy-api

Usage

Initialse like so, parameter one is your scrapoxy conf.json file containing

    use UWebPro\Scrapoxy\Container;
    
    $api = new Container(__DIR__ . '/conf.json');

If you are using a different scrapoxy host that can be changed like so, by default it is http://127.0.0.1:8889

    use UWebPro\Scrapoxy\Container;

    $api = new Container(__DIR__ . '/conf.json', 'http://127.0.0.1:8889);

Common functions

To start and stop a proxy pool

if values are left as null they will resume from previously set scaling

    $api->start(?int $min, ?int $required, ?int $max);
    $api->stop();

To Scale your proxy pool

    $api->rescale(int $min, int $required, int $max);

To list proxy instances as objects

    $api->getInstances();

Instance object

The following properties are available on the instance object

    public string $name;
    public string $type;
    public string $status;
    public array $address;
    public string $region;
    public bool $alive;
    public string $useragent;

As well as the following method

    $instance->remove();

An alternative to removing instances is

    $api->removeInstance($name);

Scrapoxy config

Scrapoxy's config can be read and updated using the following methods

    $api->getConfig(); //returns of config array
    
    $api->updateConfig($configArray);

ALL METHODS RETURN API RESPONSE

Contributing

You can contribute in one of three ways:

  1. File bug reports using the issue tracker.
  2. Answer questions or fix bugs on the issue tracker.
  3. Contribute new features or update the wiki.

You just need to make sure that you follow PSR coding guidelines.

License

MIT

统计信息

  • 总下载量: 68
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: proprietary
  • 更新时间: 2020-10-14

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固