分类 工具 下的文章

2.1

  • 已完成 加入autoload.php用于单文件调用SimpleFramework
  • 已完成 加入StringUtil
  • 优化Curl::uploadFile方法
  • 加入可扩展的命令行选项
  • 加入生成All in one PHAR归档的工具,用于单文件发布

2.2

  • 重写模块依赖加载算法(移除info.json中的order
  • info.json重命名为sf.json
  • 加入Packagist作为中央仓库 其实我也不知道咋说
  • 加入PSR-4自动加载器

其他

  • 提供SimpleFramework可用的php构建脚本 (for Linux and macOS
  • 提供可用于构建SimpleFramework可用的phpbuildroot
  • 提供预构建的php二进制可执行文件(for Windows, Linux ARMv7/AArch64

由于项目需要,我们建立了某日本插画网站的全站作品和图片数据库。
利用php-phash为每张图片生成了唯一的标识码,通过计算汉明距离进行匹配。
那么有了这些数据之后,就应该开始搭建图片搜索引擎了。

数据量

  • 作品数:3700万左右
  • 空间:1.9TB
  • 数据库:MongoDB 4.0.3

前端

  • pixiv.FUN RiseFront - 可通过Redis缓存搜索结果,组织搜索队列
  • NGINX - 反向代理RiseFront

后端

  • Pifrise - 全称为pixiv.FUN Reverse Image Search Engine

    • 通过连接MongoDB初始化数据,以及作品信息
    • 接口为HTTP协议
    • 只支持全部搜索
    • Java
  • AoiHammer - 开源的汉明距离搜索引擎,通过本地文件初始化数据

    • 接口为TCP ANSI协议
    • 支持摘要搜索和全部搜索
    • C++

性能

  • Pifrise

    • i5-2300 3600w 900ms
    • E5645 x2 3650w 490ms
    • Mem: 6GB
  • AoiHammer

    • F i5-2300 3600w 100~200ms
    • S i5-2300 3600w 500ms
    • Mem: 8GB

iTXTech Rpf

是一个为 SimpleFramework 2.1swoole 4.2 设计的可扩展的反向代理框架

几行代码就能完成一个可用的反向代理

require_once "load_env.php";

use iTXTech\SimpleFramework\Console\Logger;
use iTXTech\Rpf\{Handler, Launcher};
use Swoole\Http\{Request, Response};
use Swoole\Coroutine\Http\Client;

Logger::info("Constructing");
$launcher = (new Launcher())
    ->listen("127.0.0.1", 80)
    ->handler(new class() extends Handler{
        public function ssl(bool $ssl){
            $this->ssl = true;
        }

        public function request(Request $request){
            Logger::info("Got request from " . $request->server["remote_addr"] . " to " .
                $request->header["host"] . $request->server["request_uri"]);
        }

        public function complete(Request $request, Response $response, string $body){
            Logger::info("Got response from " . $request->header["host"] . $request->server["request_uri"] .
                " len: " . strlen($body));
        }

        public function response(Request $request, Response $response, Client $client){
            $response->header["X-Powered-By"] = "iTXTech Rpf";
            $client->body .= "\n<!-- Powered by iTXTech Rpf --!>";
        }
    });

Loader::load($launcher);

开源协议

Copyright (C) 2018 iTX Technologies

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Introduction

Bypass TLS reset (based on Server Name Indication detection) of GFW on iOS.
Details for the GFW's new feature

RESEARCH ONLY PROJECT

Roadmap

  1. Find a web framework to implement a Reverse Proxy (Kitura or Perfect)
  2. Test on macOS first
  3. Integrate with OpenSSL for self-signed certificate
  4. Build an iOS app
  5. Use Network Extension to setup a VPNService in order to intercept packets with a TUNInterface
  6. Maybe NEKit will be used to modify packets for redirection

Notes

  1. This project will be my first Swift/Objective-C project.
  2. All these technologies has been tested on Android (Using Undertow or Nginx)
  3. Contributions are welcomed. See my GitHub homepage.

Records