由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - Raspberry Pi Home Gateway
相关主题
Re: 不知道干什么来着,公司给了一个Raspberry Pi (转载)谈谈我认识的一些lisp程序员
我自己写了一个程序,专门对付GFW的,给我妈用 (转载)node express.js如何package
大家node都是跑在nginx后面吗?页面上有没可能判断访问者用没用代理服务器?
老魏我再问你HTTP Error 403
菜鸟求助:怎么自动include header file?股的霸强劲出手
url header问题VNC 求助
ask a question about compile shared library using libtoolVNC for multiple users ( >= 2) (转载)
which header file declares ntohs() in c++ ?郁闷,程序的安全性问题
相关话题的讨论汇总
话题: proxy话题: header话题: param话题: gateway话题: pi
进入Programming版参与讨论
1 (共1页)
T********i
发帖数: 2416
1
我的Raspberry Pi是作为Home Gateway用的。
1. 100% HTTPS
2. Access Devices and Services at home
3. Pure HTML 5, only web browser is required
4. Corporate gateway pass-through
How did I set up?
1. Upgrade to debian Jessie
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=66&t=47944
in /etc/apt/sources.list
deb http://mirrordirector.raspbian.org/raspbian/ wheezy main contrib non-free rpi
deb http://archive.raspbian.org/raspbian wheezy main contrib non-free rpi
# Source repository to add
deb-src http://archive.raspbian.org/raspbian wheezy main contrib non-free rpi
deb http://mirrordirector.raspbian.org/raspbian/ jessie main contrib non-free rpi
deb http://archive.raspbian.org/raspbian jessie main contrib non-free rpi
# Source repository to add
deb-src http://archive.raspbian.org/raspbian jessie main contrib non-free rpi
create /etc/apt/preferences and, if you want to track jessie, put inside
Package: *
Pin: release n=jessie
Pin-Priority: 900
Package: *
Pin: release n=wheezy
Pin-Priority: 300
Package: *
Pin: release o=Raspbian
Pin-Priority: -10
T********i
发帖数: 2416
2
2. Sign up a dynamic DNS service.
I am using noip.com
Note you need wildcard DNS support. For example, if you sign up as
jd.no-ip.biz,
then
*.jd.no-ip.biz will resolve to the same name.
c****3
发帖数: 10787
3
低功耗,就做home automation最合适。做其他的性能都差了点,网卡还是百兆的。
T********i
发帖数: 2416
4
3. Install nginx
sudo apt-get install nginx
4. install guacamole
And dependencies, including open-jdk-7, tomcat6 etc,
Make sure you also install RDP and VNC connectors
T********i
发帖数: 2416
5
My guacamole config:
sudo nano /etc/guacamole/user-mapping.xml



rdp
192.168.11.XXX
3389
true


vnc
192.168.11.XXX
5800


ssh
localhost
22


T********i
发帖数: 2416
6
My nginx config:
sudo nano /etc/nginx/sites-available/default
server {
listen 443 ssl;
server_name XXXX.no-ip.biz alias qwha.XXXX.no-ip.biz;
ssl_certificate /etc/QWHA/Cert/qwha_server.crt;
ssl_certificate_key /etc/QWHA/Cert/qwha_server.key;
ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
location /qwhaadmin/websocket {
proxy_pass https://127.0.0.1:8443;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 86400;
proxy_set_header X-Real-IP "${remote_addr}:${remote
_port}";
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_
for;
}
location /qwhawebclient/websocket {
proxy_pass https://127.0.0.1:8443;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 86400;
proxy_set_header X-Real-IP "${remote_addr}:${remote
_port}";
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_
for;
}
location / {
proxy_pass https://127.0.0.1:8443;
proxy_next_upstream error timeout invalid_header http_500
http_502 http_503 http_504;
proxy_redirect off;
proxy_buffering on;
proxy_set_header Host qwha.XXXX.no-ip.
biz;
proxy_set_header X-Real-IP "${remote_addr}:${
remote_port}";
proxy_set_header X-Forwarded-For $proxy_add_x_
forwarded_for;
}
}
server {
listen 443 ssl;
server_name remote.XXXX.no-ip.biz;
ssl_certificate /etc/QWHA/Cert/qwha_server.crt;
ssl_certificate_key /etc/QWHA/Cert/qwha_server.key;
ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
location / {
proxy_pass http://127.0.0.1:8080;
proxy_next_upstream error timeout invalid_header http_500
http_502 http_503 http_504;
proxy_redirect off;
proxy_buffering off;
proxy_set_header Host remote.XXXX.no-
ip.biz;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_
forwarded_for;
}
}
T********i
发帖数: 2416
7
结果:
https://qwha.XXXX.no-ip.biz
访问我的home automation server,也运行在Raspberry Pi上。
https://remote.XXXX.no-ip.biz
访问我的guacamole,
用HTML 5 browser remote desktop你的 PC。
用HTML 5 browser SSH你的Raspberry Pi
也可以用HTML5 based VNC。
还可以map你的摄像头,比如camera1, camera2 etc...
怎么样?安全,而且全覆盖。
top - 16:45:19 up 27 days, 19:44, 1 user, load average: 0.05, 0.05, 0.05
Tasks: 72 total, 1 running, 71 sleeping, 0 stopped, 0 zombie
%Cpu(s): 2.5 us, 3.2 sy, 0.0 ni, 94.2 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0
st
KiB Mem: 496948 total, 309556 used, 187392 free, 50548 buffers
KiB Swap: 102396 total, 0 used, 102396 free, 169840 cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
9721 root 20 0 54428 7620 4592 S 1.6 1.5 489:38.93 qwhaserver
19206 pi 20 0 4900 1404 1012 R 1.6 0.3 0:00.14 top
T********i
发帖数: 2416
8
你的上传可能10M都不到。
我这个,可以在任何地方用HTTPS远程登录我的PC,家里的摄像头,Home Automation,
SSH,VNC。
不管你是在图书馆,还是公司,都通吃。有人玩过么?

【在 c****3 的大作中提到】
: 低功耗,就做home automation最合适。做其他的性能都差了点,网卡还是百兆的。
a*w
发帖数: 4495
9
里面有个host header是hard-coded, 为啥?

【在 T********i 的大作中提到】
: My nginx config:
: sudo nano /etc/nginx/sites-available/default
: server {
: listen 443 ssl;
: server_name XXXX.no-ip.biz alias qwha.XXXX.no-ip.biz;
: ssl_certificate /etc/QWHA/Cert/qwha_server.crt;
: ssl_certificate_key /etc/QWHA/Cert/qwha_server.key;
: ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
: ssl_ciphers HIGH:!aNULL:!MD5;
: location /qwhaadmin/websocket {

T********i
发帖数: 2416
10
多谢,改了。
是http 1.1回传的host name。你需要自己设定。

【在 a*w 的大作中提到】
: 里面有个host header是hard-coded, 为啥?
相关主题
url header问题谈谈我认识的一些lisp程序员
ask a question about compile shared library using libtoolnode express.js如何package
which header file declares ntohs() in c++ ?页面上有没可能判断访问者用没用代理服务器?
进入Programming版参与讨论
S*A
发帖数: 7142
11
顺便配个 VPN 可以用 ipad 连回家的网络吧。
正好可以学习一下如何配。
h*******t
发帖数: 2679
12
你低估了rpi.
omxh264enc/dec 用gstreamer1.0都打通了.
rpi的video效果也非常赞.

【在 c****3 的大作中提到】
: 低功耗,就做home automation最合适。做其他的性能都差了点,网卡还是百兆的。
g****t
发帖数: 31659
13
不错,收藏了.

【在 T********i 的大作中提到】
: 我的Raspberry Pi是作为Home Gateway用的。
: 1. 100% HTTPS
: 2. Access Devices and Services at home
: 3. Pure HTML 5, only web browser is required
: 4. Corporate gateway pass-through
: How did I set up?
: 1. Upgrade to debian Jessie
: http://www.raspberrypi.org/phpBB3/viewtopic.php?f=66&t=47944
: in /etc/apt/sources.list
: deb http://mirrordirector.raspbian.org/raspbian/ wheezy main contrib non-free rpi

M**A
发帖数: 78
14
魏老师,
非常感谢你的安装心得。
Guacamole使用 HttpTunnel instead of WebSockets, older web browsers (even
IE5.0?) work without a problem.
不一定非用HTML 5 browser。
在GitHub上的Guacamole才有对文件上传的支持。最新0.8.3 stable release不支持文
件上传。通过Guacamole gateway上传文件取决于Client->Guacamole gateway的带宽和
Guacamole gateway-〉PC的带宽。文件上传需要Guacamole gateway的中转。
Guacamole主要消耗CPU,内存几乎可以忽略。
GitHub上还有FreeRDP-WebConnect, 另1个开源gateway for accessing RDP sessions
using any HTML5 compliant browser。
https://github.com/FreeRDP/FreeRDP-WebConnect
https://github.com/cloudbase/FreeRDP-WebConnect
Debian/Ubuntu
sudo apt-get install freerdp-x11
sudo apt-get install wsgate
Windows
http://www.fritz-elfert.de/downloads/
FreeRDP-WebConnect用户指南
http://www.youtube.com/watch?v=lZpRLtHV0iY
知識記錄: FreeRDP 一套基於Linux的遠端桌面連線利器
附上FreeRDP團隊於Linux中利用FreeRDP遠端至Windows主機上打電動的情形
http://knowledgeqhair.blogspot.ca/2012/08/freerdp-linux.html
FreeRDP-WebConnect不需要"set up individual accounts locally and configure
each one to connect to a predetermined PC."
FreeRDP-WebConnect(WebSockets, Client->gateway)和Guacamole(HttpTunnel, ,
Client->gateway)几乎同时开工.
太可惜了,FreeRDP-WebConnect项目2012年9月后停工。
g*******t
发帖数: 7704
15
Router都能干?
a*w
发帖数: 4495
16
我的意思是为什么不用$host, $proxy_host等现成的变量,而手工
输入域名?

【在 T********i 的大作中提到】
: 多谢,改了。
: 是http 1.1回传的host name。你需要自己设定。

T********i
发帖数: 2416
17
$host:$server_port应该可以。貌似$host没有port。
但是如果$server_port是缺省,也不必加上。
总之,反正就是copy一下,肯定能work。至于是不是有现成的变量,我不确定。

【在 a*w 的大作中提到】
: 我的意思是为什么不用$host, $proxy_host等现成的变量,而手工
: 输入域名?

a****x
发帖数: 231
18
在路由器上装个OpenVPN是不是更省事一些。
m****a
发帖数: 2593
19
Pi 是个好东西啊
Tor based access point
http://learn.adafruit.com/onion-pi/overview
How to Turn a Raspberry Pi into an Always-On BitTorrent Box
http://www.howtogeek.com/142044/how-to-turn-a-raspberry-pi-into

【在 T********i 的大作中提到】
: 我的Raspberry Pi是作为Home Gateway用的。
: 1. 100% HTTPS
: 2. Access Devices and Services at home
: 3. Pure HTML 5, only web browser is required
: 4. Corporate gateway pass-through
: How did I set up?
: 1. Upgrade to debian Jessie
: http://www.raspberrypi.org/phpBB3/viewtopic.php?f=66&t=47944
: in /etc/apt/sources.list
: deb http://mirrordirector.raspbian.org/raspbian/ wheezy main contrib non-free rpi

1 (共1页)
进入Programming版参与讨论
相关主题
郁闷,程序的安全性问题菜鸟求助:怎么自动include header file?
RHEL 的文本编辑除了 gedit,还有哪个?url header问题
如何截获屏幕图像?ask a question about compile shared library using libtool
Re: How to write this makefile?which header file declares ntohs() in c++ ?
Re: 不知道干什么来着,公司给了一个Raspberry Pi (转载)谈谈我认识的一些lisp程序员
我自己写了一个程序,专门对付GFW的,给我妈用 (转载)node express.js如何package
大家node都是跑在nginx后面吗?页面上有没可能判断访问者用没用代理服务器?
老魏我再问你HTTP Error 403
相关话题的讨论汇总
话题: proxy话题: header话题: param话题: gateway话题: pi