您的位置:首页 > 理论基础 > 计算机网络

在openwrt中对https 数据的转发到 云端

2015-09-16 00:54 375 查看
本测试选用  路由器为
   TP-Link TL-WR703N 无线路由器裸板 16M/64M OpenWrt

测试固件: http://pan.baidu.com/s/1i3wBU5n
云端:  选用bmob的后台测试

openwrt的刷机,大概有几种方法,这里主要记录一下“不死uboot的方法” ,可以直接搜索这个关键词的相关文章;在这个过程中
最好有TTL看下系统log信息,然后根据log选择对应功能。

     1.启动后路由后台,升级固件;

     2.不死uboot选择web更新后,进入路由器,升级固件;注意PC  IP   LAN口等等连接跟配置;

关于openwrt的源问题,国外的源不稳定,这里需要使用中科大的源:

src/gz chaos_calmer_base http://mirrors.ustc.edu.cn/openwrt/snapshots/trunk/ar71xx/generic/packages/base src/gz chaos_calmer_luci http://mirrors.ustc.edu.cn/openwrt/snapshots/trunk/ar71xx/generic/packages/luci src/gz chaos_calmer_management http://mirrors.ustc.edu.cn/openwrt/snapshots/trunk/ar71xx/generic/packages/management src/gz chaos_calmer_packages http://mirrors.ustc.edu.cn/openwrt/snapshots/trunk/ar71xx/generic/packages/packages src/gz chaos_calmer_routing http://mirrors.ustc.edu.cn/openwrt/snapshots/trunk/ar71xx/generic/packages/routing
src/gz chaos_calmer_telephony http://mirrors.ustc.edu.cn/openwrt/snapshots/trunk/ar71xx/generic/packages/telephony # src/gz chaos_calmer_targets http://mirrors.ustc.edu.cn/openwrt/snapshots/trunk/ar71xx/generic/packages/targets
**需要注意版本的匹配,如果遇到,opkg install xxx ,   。。。not found,重新刷固件再测试,具体为什么,还不明白原因;

curl 通过https 访问 rest api的接口,通过 -k 可以忽略证书!!!

#-k, --insecure      Allow connections to SSL sites without certs (H)
下面是测试记录:
root@OpenWrt:~# curl -k  -X GET -H "X-Bmob-Application-Id: xxxx" X-Bmob-REST-API-Key: xxxxxxx" https://api.bmob.cn/1/classes/CIP_ESP

{"results":[{"count":22,"createdAt":"2015-09-09 10:17:52","namdID":"testid_name","objectId":"5d5393dd61","updatedAt":"2015-09-09 10:17:52"},{"count":22,"createdAt":"2015-09-10 10:19:00","namdID":"testid_name","objectId":"a28a1ad642","updatedAt":"2015-09-10 10:19:00"},{"count":23,"createdAt":"2015-09-10 13:05:47","namdID":"testid_name","objectId":"92be34da7d","updatedAt":"2015-09-10 13:05:47"},{"count":5,"createdAt":"2015-09-10 14:24:21","namdID":"Woonkamer","objectId":"a760efea81","updatedAt":"2015-09-10 14:24:21"},{"count":6,"createdAt":"2015-09-10 14:25:45","namdID":"Woonkamer","objectId":"c4df5e993a","updatedAt":"2015-09-10 14:25:45"},{"count":7,"createdAt":"2015-09-10 14:26:20","namdID":"Woonkamer","objectId":"376ab22054","updatedAt":"2015-09-10 14:26:20"},{"count":7,"createdAt":"2015-09-10 16:03:54","namdID":"Woonkamer","objectId":"1135339962","updatedAt":"2015-09-10 16:03:54"}]}

root@OpenWrt:~# 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: