java打印对象内存地址 分布式事务 事务消息 分布式事务 几种解决方案 分布式事务-Seata 分布式事务-Seata 分布式事务-LCN-TCC 分布式事务-LCN 分布式事务-消息队列-定时任务-本地事件表 Zuul网关实战02 Zuul网关实战01 灰度发布落地实战2 灰度发布落地实战1 Gsnova on Heroku build Systemd Debian system initialization manage multi id_rsa ubuntu 64bits cannot run 32bits app REHL power auditing Debug Assembly for ARMv8 on QEMU ARM体系结构--寄存器 Run Debian iso on QEMU ARMv8 QEMU ARM64 guide cross compiler install buildroot install QEMU install python入门--数据结构 python入门--内置数据类型 python入门--类 异常 python入门--条件表达式 方法 python入门--数字 字符串 数组 RTC驱动分析 块设备驱动 TCP UDP socket 触摸屏驱动 USB驱动 LED按键中断 LCD 驱动 驱动信号 根文件系统 实验 内核实验 字符设备驱动程序 绪论 uboot 实验 LCD 实验 系统时钟和UART 中断控制器 Nand Flash控制器 MMU 实验 储存管理器实验 GPIO实验 点亮LED 编译加载驱动 制作烧写内核 dnw替代方法 MINI2440 TQ2440安装配套Linux 使用NFS 制作烧写跟文件系统 grub引导Windows 烧写裸版程序-linux Ubuntu 网络没有 eth0 Linux自动挂载 烧写裸板程序 电路基础 Mac词典 Vim插件 Assembly 综合研究 Assembly 指令总结 Assembly 直接定址表 Assembly 使用BIOS进行键盘输入和磁盘读写 Assembly 外中断 Assembly 端口 Assembly int指令 Assembly 内中断 Assembly 标志寄存器 Assembly 转移指令的原理 Assembly Call和ret指令 Assembly 数据处理两个基本问题 Assembly 灵活定位内存地址 Assembly 包含多个段的程序 Assembly [bx] loop Assembly 第一个程序 Assembly 寄存器 (内存访问) Assembly 寄存器 AWS VPN with EC2 hidden file in picture(linux) Assembly 基础 idea shortcuts 常用快捷键 idea plugin folder install ruby and jekyll

Gsnova on Heroku

2015年12月01日

#Deploy Gsnova

Aim: Deploy a proxy application(Gsnova) on PaaS(Herokug) and use it

Heroku is a platform as a service (PaaS) that enables developers to build and run applications entirely in the cloud. (can create free account)

https://heroku.com

Gsnova inherit from snova , a Proxy application on PaaS

https://github.com/yinqiwen/gsnova

##step 1 Heroku Client env register a account from Heroku and install Heroku Toolbelt

Windows can use CMD.exe or Cygwin

##Step 2 deploy Snova C4 server on Heroku download snova-c4-server-[version].war

https://code.google.com/p/snova/downloads/list

cd $war's_directory

heroku login

heroku plugins:install https://github.com/heroku/heroku-deploy  --just run only once

heroku apps:create      --create a app,name in random ,please remember this appname ($app_name.herokuapp.com), It is not nessesary run this when update

heroku deploy:war --war <path_to_war_file> --app <app_name> 

heroku apps  --list all apps

Creating evening-basin-7128... done, stack is cedar-14
https://evening-basin-7128.herokuapp.com/ | https://git.heroku.com/evening-basin
-7128.git

heroku deploy:war --war snova-c4-java-server-0.22.0.war --app evening-basin-7128

In this example, my app name is evening-basin-7128

####troubleshooting When you deploy the war, caught a SSL Exception:

D:\dev\snova-server>heroku deploy:war --war snova-c4-java-server-0.22.0.war --ap
p evening-basin-7128
Uploading snova-c4-java-server-0.22.0.war....
-----> Packaging application...
       - app: evening-basin-7128
       - including: webapp-runner.jar
       - including: snova-c4-java-server-0.22.0.war
-----> Creating build...
       - file: slug.tgz
       - size: 8MB
-----> Uploading build...
Exception in thread "main" javax.net.ssl.SSLHandshakeException: Remote host clos
ed connection during handshake
        at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:992)
        at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.
java:1375)
        at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403
)
        at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387
)
        at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSock
et(SSLConnectionSocketFactory.java:395)
        at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSL
ConnectionSocketFactory.java:354)
        at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect
(DefaultHttpClientConnectionOperator.java:134)
        at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(
PoolingHttpClientConnectionManager.java:353)
        at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClie
ntExec.java:380)
        at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.
java:236)
        at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java
:184)
        at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)
        at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java
:110)
        at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttp
Client.java:184)
        at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttp
Client.java:82)
        at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttp
Client.java:107)
        at com.heroku.sdk.deploy.utils.RestClient.put(RestClient.java:120)
        at com.heroku.sdk.deploy.endpoints.ApiEndpoint.upload(ApiEndpoint.java:4
0)
        at com.heroku.sdk.deploy.BuildsDeployer.deploySlug(BuildsDeployer.java:9
9)
        at com.heroku.sdk.deploy.Deployer.createAndReleaseSlug(Deployer.java:108
)
        at com.heroku.sdk.deploy.Deployer.deploy(Deployer.java:69)
        at com.heroku.sdk.deploy.App.deploy(App.java:57)
        at com.heroku.sdk.deploy.App.deploy(App.java:61)
        at com.heroku.sdk.deploy.WarApp.deploy(WarApp.java:30)
        at com.heroku.sdk.deploy.DeployWar.main(DeployWar.java:70)
Caused by: java.io.EOFException: SSL peer shut down incorrectly
        at sun.security.ssl.InputRecord.read(InputRecord.java:505)
        at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:973)
        ... 24 more

Solution: open VPN or set $http_proxy $https_proxy and re-try

D:\dev\snova-server>heroku deploy:war --war snova-c4-java-server-0.22.0.war --ap
p evening-basin-7128
Uploading snova-c4-java-server-0.22.0.war....
-----> Packaging application...
       - app: evening-basin-7128
       - including: webapp-runner.jar
       - including: snova-c4-java-server-0.22.0.war
-----> Creating build...
       - file: slug.tgz
       - size: 8MB
-----> Uploading build...
       - success
-----> Deploying...
remote:
remote: -----> Fetching set buildpack https://codon-buildpacks.s3.amazonaws.com/
buildpacks/heroku/jvm-common.tgz... done
remote: -----> JVM Common app detected
remote: -----> Installing OpenJDK 1.8... done
remote:
remote: -----> Discovering process types
remote:        Procfile declares types -> web
remote:
remote: -----> Compressing... done, 57.5MB
remote: -----> Launching... done, v3
remote:        https://evening-basin-7128.herokuapp.com/ deployed to Heroku
remote:
-----> Done

##step 3 install Client https://code.google.com/p/snova/downloads/list

##step 4 Configure the Client edit Client config file, replace the app name

vi /gsnova-0.22.1/gsnova.conf

[LocalServer]
Listen=0.0.0.0:48100
[C4]
Enable=1
Listen=0.0.0.0:48102
WorkerNode[0]=https://evening-basin-7128.herokuapp.com
ReadTimeout = 25
MaxConn = 3
WSConnKeepAlive = 1800
Compressor=Snappy
Encrypter=RC4
UseSysDNS=0
MultiRangeFetchEnable=0
RangeFetchLimitSize=262144
RangeConcurrentFetcher=3
InjectRange=*.c.youtube.com|av.vimeo.com|av.voanews.com
UserAgent=Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20100101 Firefox/15.0.1
Proxy=

##step 5 use proxy

once configurationed, Run client app:

./gsnova

I use Chrome with SwitchySharp plugin

or set $http_proxy to use the client proxy ip

enjoy it

##Complie Gsnova read README file on https://github.com/yinqiwen/gsnova

###troubleshooting When compiling error, try remove icon.syso file

#Reference https://github.com/yinqiwen/gsnova/blob/develop/README.md