迅雷离线远程下载工具

立项背景

拖大文件离不了迅雷离线,但公司下载不方便,而家里的网络又足够好。于是我采用过如下方案:
1 路由DMZ或者转发端口,直接远程家里的机器(VNC/RDP),开迅雷,登录会员,添加链接。
2 Wyse PocketCloud Pro,在家里电脑上(Win/Mac)安装WYSE的电脑端,iOS上装WYSE的移动端,使用Google账号实现互通。
两种方案本质都是远程桌面的实现。远程桌面对网络的要求相对较高(虽然可以8bit的颜色显示,但是终究麻烦),而且需要特定的终端软件,并且URL的复制受限于客户端实现。方案2能很好地解决方案1中运营商限制导致的网络不可连,但是也经常面临着被墙的风险。

项目构想

借着有Mac Mini和一个WD的小NAS,希望开发一个web服务,能提交URL,添加任务到迅雷离线,下载完成后拖回本地。方案暂不考虑运营商限制导致的网络连接不畅,直接使用DDNS+端口转发访问内网Web服务调用下载功能。
调研的结论是,aria2是最适合于我的构想的一个下载后端。

项目地址

https://github.com/sskaje/xunlei

项目环境

硬件:LinkSys EA6500(192.168.1.1) + WD MyBookLive(192.168.1.135)
软件:Debian 5.0.4 powerpc(on WD MyBookLive), aria2 1.15.1, Apache 2.2.9, PHP 5.2.6

Continue reading “迅雷离线远程下载工具” »

迅雷离线远程下载工具 by @sskaje: https://sskaje.me/2013/07/xunlei/

Incoming search terms:

PHP JSON-RPC Client Class

https://github.com/sskaje/jsonrpc

JSON-RPC 2.0 supported without notification and batch request.

Based on php_curl, currently available options auth_user and auth_pass for http basic auth.

PHP JSON-RPC Client Class by @sskaje: https://sskaje.me/2013/07/simple-json-rpc-client-class/

MQTT client lib in PHP

UPDATE:
SUBSCRIBE/SUBACK/UNSUBSCRIBE/UNSUBACK are now supported

===========================

MQ Telemetry Transport, MQTT is a machine-to-machine (M2M)/”Internet of Things” connectivity protocol. It was designed as an extremely lightweight publish/subscribe messaging transport. It is useful for connections with remote locations where a small code footprint is required and/or network bandwidth is at a premium.

In the ‘software’ page, I found two client libs in PHP, phpMQTT by @bluerhinos and PECL SAM, outdated or dead.

I chose phpMQTT in my project publishing message to mosquitto but found it somewhat too old and lack of QoS support. I decided to code my own.

I spended 6 hours watching CSL, Bundesliga, and Barclay’s English Premier League, then brought out this: https://github.com/sskaje/mqtt. Almost the most ugly code I’ve ever written.

Only PUBLISH and it’s related commands are supported until I have enough time to finish it.

It might be a choice to those who are publishing their messages and not subscribing any topic.

MQTT client lib in PHP by @sskaje: https://sskaje.me/2013/04/mqtt-client-lib-in-php/

Incoming search terms:

PHP Client for Apple Push Notification Service

源码在:https://github.com/sskaje/apns

协议消息体使用的是APNS的简版消息结构,暂不支持Enhanced notification format,即不支持identifier和expiry,省了8个字节,不过稍后有空会加上。

大致的数据逻辑是:

走了个异步队列。应用将推送数据按公用结构(适配非APNS的推送需求)带上推送的目标设备类型+客户端标识(支持同平台下多款应用的推送)所用的队列;后端程序阻塞或非阻塞的模式从队列里取数据,然后根据数据信息写APNS或者其他类型终端(例如Android)的推送服务。

开发过程中遇到的最大问题主要在 stream_socket_client() 的 STREAM_CLIENT_PERSISTENT 使用上:

Continue reading “PHP Client for Apple Push Notification Service” »

PHP Client for Apple Push Notification Service by @sskaje: https://sskaje.me/2012/11/apns-client/

Incoming search terms: