All Projects → webx-top → tower

webx-top / tower

Licence: other
基于反向代理的Golang即时编译工具,可在生产环境下无缝切换到新版本

Programming Languages

go
31211 projects - #10 most used programming language
Batchfile
5799 projects
shell
77523 projects

Projects that are alternatives of or similar to tower

node-docker
Guide for Writing Dockerfiles for Node.js Applications
Stars: ✭ 91 (+333.33%)
Mutual labels:  live-reload
GithubTower
This browser extension allows you to use Github's "Clone in Desktop" button with Tower
Stars: ✭ 48 (+128.57%)
Mutual labels:  tower
arelo
a simple auto reload (live reload) utility
Stars: ✭ 54 (+157.14%)
Mutual labels:  live-reload
LiveReloadServer
A self-contained, local, cross-platform, static file Web Server with automatic Live Reloading, Markdown rendering and loose Razor Pages support.
Stars: ✭ 69 (+228.57%)
Mutual labels:  live-reload
Toolbelt.Blazor.DevServer.WithCssLiveReloader
Development server for use when building Blazor applications, with CSS Live Reloader.
Stars: ✭ 18 (-14.29%)
Mutual labels:  live-reload
ansible-tower-cicd
A framework for continuous integration and continuous delivery with Ansible Tower.
Stars: ✭ 37 (+76.19%)
Mutual labels:  tower
electron-angular-webpack
A simple kit for Electron, Angular 6 and Webpack 4 including a live reload system for Angular.
Stars: ✭ 62 (+195.24%)
Mutual labels:  live-reload
DeadAscend
A 2D point'n'click-like adventure game written in Qt/QML and Javascript
Stars: ✭ 37 (+76.19%)
Mutual labels:  tower
flow-watch
clear the console and run flow on file changes
Stars: ✭ 30 (+42.86%)
Mutual labels:  file-watcher
towerlib
A python library to interface with ansible tower's (awx) api.
Stars: ✭ 30 (+42.86%)
Mutual labels:  tower
tower-lsp
Language Server Protocol implementation written in Rust
Stars: ✭ 455 (+2066.67%)
Mutual labels:  tower
bc-website
HARDWARIO Website, Documentation and Blog
Stars: ✭ 15 (-28.57%)
Mutual labels:  tower
mock-json-server
A mock web server using a JSON file with live-reload support.
Stars: ✭ 31 (+47.62%)
Mutual labels:  live-reload
live-reload-vanilla-website-template
Template to build a website without a front-end framework, including transpilation of ES6+ JavaScript and Sass support
Stars: ✭ 47 (+123.81%)
Mutual labels:  live-reload
docker-rabbitmq-node
🐳 A playground for Docker with RabbitMQ and Node.
Stars: ✭ 32 (+52.38%)
Mutual labels:  live-reload
universal-hot-reload
Hot reload client and server webpack bundles for the ultimate development experience
Stars: ✭ 79 (+276.19%)
Mutual labels:  live-reload
go-docker
Sample code and dockerfiles accompanying the blog post The Ultimate Guide to Writing Dockerfiles for Go Web-apps
Stars: ✭ 89 (+323.81%)
Mutual labels:  live-reload
cheap-watch
If it works, why use something else? // Mirror of https://git.chor.date/Conduitry/cheap-watch
Stars: ✭ 64 (+204.76%)
Mutual labels:  file-watcher
docker-nginx-certbot
Automatically create and renew website certificates for free using the Let's Encrypt certificate authority.
Stars: ✭ 367 (+1647.62%)
Mutual labels:  live-reload
vscode-live-server-plus-plus
VsCode Live Server++ : It's Truly Live 😊 (BETA) -- [NOT RELEASED YET]
Stars: ✭ 198 (+842.86%)
Mutual labels:  live-reload

Tower

Tower 是一个为golang的web开发者提供的工具。它会动态监控文件更改并自动重新编译运行您的golang源码。 它采用了反向代理的方式,自动将用户的访问代理到新的程序,然后关闭并删除旧程序,这样就可以最大限度的做到零下线升级您的golang应用。

如果编译失败或出现异常,Tower会通过一个整洁的页面显示这些信息:

安装

go get github.com/webx-top/tower

使用方法

cd your/project
tower # 现在访问 localhost:8080

Tower 在默认情况下假设你golang应用的端口为 5001-5050。你可以按如下方式更改它:

tower -p 3000-4000

当需要编译单个go文件时,您可以通过-m来指定:

tower -m app.go -p 3000-4000

或把它们放入配置文件:

tower init
vim tower.yml
tower

常见问题

'Too many open files'

运行下面的命令提高进程可打开的文件数量:

ulimit -S -n 2048 # OSX

工作原理

浏览器访问: http://localhost:8080
      \/
tower (监听 8080 端口)
      \/ (反向代理)
你的golang应用 (监听 5001 至 5050 中的任意一个端口)

所有来自localhost:8080的提交Tower都会转发给你的应用。 转发使用的是 httputil.ReverseProxy。 在转发之前,如果您的应用没有运行或文件被更改,Tower将在其它进程中自动编译并运行你的应用; Tower 使用了 howeyc/fsnotify 来监控文件更改。

管理接口

通过管理接口您可以临时关闭自动编译功能。

  默认情况下,只有本地可以访问管理接口,您可以通过在配置文件中设置`admin_pwd`(指定访问密码,通过在网址中增加“?pwd=<你的密码>”来访问)或`admin_ip`(指定允许访问的IP地址,多个用半角逗号隔开)来灵活设置。

要临时关闭自动编译功能只需要访问:http://localhost:8080/tower-proxy/watch/pause

重新开启自动编译:http://localhost:8080/tower-proxy/watch/begin

查看是否开启自动编译:http://localhost:8080/tower-proxy/watch

Tower在生产环境中的应用

在生产环境中,我们一般都是放一个编译好的可执行文件上去,并执行此文件来启动web服务。

当需要更新此程序时,我们就需要停止服务,这样就会导致web服务中断,体验不佳。

而这时,使用Tower就可以避免这个问题,只要可执行文件名称符合这样的格式tower-app-<纯数字版本编号>.exetower-app-<纯数字版本编号>, 并且将该文件放到被监控的目录中,Tower就会自动发现它,并自动提取出<纯数字版本编号>来和已经运行的版本编号进行比较, 当前者大于后者时,Tower会自动启动大版本程序,并将所有访问转发给它, 然后关闭并删除小版本程序,在此过程中服务不会中断。

License

Tower is released under the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].