Giter Club home page Giter Club logo

switchhosts's Introduction

SwitchHosts

Homepage: https://switchhosts.vercel.app

SwitchHosts is an App for managing hosts file, it is based on Electron , React, Jotai , Chakra UI, CodeMirror, etc.

Screenshot

Capture

Features

  • Switch hosts quickly
  • Syntax highlight
  • Remote hosts
  • Switch from system tray

Install

Download

You can download the source code and build it yourself, or download the built version from following links:

You can also install the built version using the package manager Chocolatey:

choco install switchhosts

Backup

SwitchHosts stores data at ~/.SwitchHosts (Or folder .SwitchHosts under the current user's home path on Windows), the ~/.SwitchHosts/data folder contains data, while the ~/.SwitchHosts/config folder contains various configuration information.

Develop and build

Development

  • Install Node.js
  • Change to the folder ./, run npm install to install dependented libraries
  • Run npm run dev to start the development server
  • Then run npm run start to start the app for developing or debuging

Build and package

  • It is recommended to use electron-builder for packaging
  • Go to the ./ folder
  • Run npm run build
  • Run npm run make, if everything goes well, the packaged files will be in the ./dist folder.
  • This command may take several minutes to finish when you run it the first time, as it needs time to download dependent files. You can download the dependencies manually here, or Taobao mirror, then save the files to ~/.electron . You can check the Electron Docs for more infomation.
# build
npm run build

# make
npm run make # the packed files will be in ./dist

Copyright

SwitchHosts is a free and open source software, it is released under the Apache License.

switchhosts's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

switchhosts's Issues

性能优化下?

1、每次点击 图标都会生成一个实例
2、每次最小化在托盘,双击打开都很慢

打不开

win7 x64 双击看到托盘图标,鼠标移上消失,打不开

host内容:
203.208.46.30 www.google.com.hk code.google.com mail.google.com docs.google.com video.google.com webcache.googleusercontent.com ghs.google.com maps.google.com
203.208.46.30 blogsearch.google.com clients1.google.com clients2.google.com translate.google.com spreadsheets.google.com sites.google.com appengine.google.com chrome.google.com
203.208.46.30 mts1.google.com mts0.google.com lh3.googleusercontent.com lh5.googleusercontent.com lh1.googleusercontent.com lh2.googleusercontent.com lh4.googleusercontent.com lh6.googleusercontent.com picasaweb.google.com
203.208.46.30 plus.google.com talkgadget.google.com ditu.google.com
#10.249.198.117 assets.daily.taobao.net u.taobao.net #ucool dev
#10.249.192.48 assets.daily.taobao.net
#174.36.30.67 dropbox.com
#174.36.30.71 www.dropbox.com
#75.101.129.115 dl.dropbox.com
#75.101.159.151 dl-web.dropbox.com
#174.36.30.67 forums.dropbox.com
#10.249.196.128 a.tbcdn.cn assets.taobaocdn.com

10.249.196.128 assets.daily.taobao.net
#10.13.37.67 assets.daily.taobao.net
#127.0.0.1 assets.daily.taobao.net u.taobao.net
#110.75.14.33 assets.taobaocdn.com a.tbcdn.cn #assets 棰勫彂

10.232.11.217 img02.daily.taobaocdn.net

浜ゆ槗骞冲彴棰勫彂甯僪ost

#110.75.13.96 buy.taobao.com #buy prepub
#110.75.25.207 trade.taobao.com #trade prepub

crm鏈満寮€鍙戠粦瀹?

#10.232.15.172 buy.daily.taobao.net trade.daily.taobao.net #缁熶竴涓嬪崟
#10.13.37.66 buy.daily.taobao.net
#110.75.13.120 cart.taobao.com #cart prepub
#110.75.14.201 tui.taobao.com
#110.75.14.35 game.taobao.com
#10.232.41.123 a.tbcdn.cn #search xxxxx source server
#110.75.25.213 thbuy.taobao.com thtrade.taobao.com
#10.13.34.57 buy.daily.taobao.net
#10.232.15.128 trade.daily.taobao.net buy.daily.taobao.net

[feature request] 能不能加一个永久host功能

简述一下,就是有一个host文件,无论我切换到哪个host,那里配置的host都会生效。

原因是这样的,虽然要各个环境切换host,但是一些内部管理工具一般是稳定的,比如上线系统,比如代码review系统,现在一切换host,要想让这些东西总是生效,就不得不在每个host文件头部,都加一段一样的host配置,各个文件又不会自动同步,维护起来很不方便。

图标换个不要这么醒目的

图标换个不要这么醒目的, 例如淡蓝色, 淡绿色,淡黄色, 旺旺 轩辕剑 的颜色。

一般太亮了 我会关了它, 因为分散了工作注意力

建议增加自定义快捷键的功能..

复制删除什么的....仿VI也行...不过用惯了eclipse,老喜欢按CTRL+D删除行.郁闷啦.

当然可以预设几套方案来选择也好,例如VI方案/eclipse方案等等~~~

建议

在软件已经开启的情况下,再次点击打开软件.exe的时候应该直接弹出软件界面比较好。

在win8 x64运行后打不开界面

最新版本,0.2.2.1797,之前是可以的,后来不知道什么时候开始,启动后就不弹出界面来了,托盘是有的,但是右键没反应,双击也激活不了主界面,简单一句话,用不了了~~~~~~~~~~~~

切换hosts的时候提示无权限

hi
我使用SwitchHosts,进行hosts切换到时候,总是提示,系统的hosts文件无权限。
使用环境:win7,以管理员身份启动程序
提示信息如下:

出错啦!

切换 hosts 失败!
没有修改 'C:\Windows\System32\drivers\etc\hosts' 的权限!

建议加入开机启动的功能.和网络功能

建议加入开机启动的功能.或者给个参数,-min,启动时缩到托盘.这样就OK了.很实用,很需要.

另外如果能搞得更高级点的话,把HOST SERVER给做了.这个只需要考虑局域网环境就够了,那容易很多,那同事之间可以随意共享HOST,项目新版本出来的时候,只需要有一个人建好HOST,然后选择所有在线的人,把新的HOST PUSH给其它人就好了,每个人都可以是推送者,也可以是接收者,同意后接收并应用(或者稍后手动应用).这个很有需求啊..有这个话,我就可以建议我们公司这么干了~而且又可以统一某个版本用的HOST,不会导致不同的人有不同的HOST,搞到有时候查BUG查到最后居然是HOST没配对!!郁闷到底.(这个可以参考飞鸽传书.其实也很好做..)

去重以及合并还有启动慢

去重:host太多 不可能一个个看是否有重复的
合并:导入新的host时合并原有的(也是去重的一部分)
还有就是启动有些慢

old J

那啥,Windows 系统要是不再C盘下的话是无法应用修改后的host,建议将hosts文件所在的文件所在的位置写入配置文件中

运行错误

File "/home/tux/proj/hub/py/SwitchHosts/src/libs/ui.py", line 145, in init
self.m_textCtrl_content = self.makeTextCtrl(bSizer6)
File "/home/tux/proj/hub/py/SwitchHosts/src/libs/ui.py", line 222, in makeTextCtrl
txt_ctrl.SetMaxLength(0)
AttributeError: 'HostsCtrl' object has no attribute 'SetMaxLength'

grep SetMaxLength -r /usr/lib/python2.7/site-packages/wx-2.8-gtk2-unicode/wx/ |grep def

/usr/lib/python2.7/site-packages/wx-2.8-gtk2-unicode/wx/_controls.py: def SetMaxLength(_args, *_kwargs):
/usr/lib/python2.7/site-packages/wx-2.8-gtk2-unicode/wx/richtext.py: def SetMaxLength(_args, *_kwargs):

能不能设置单一实例啊

每次打开都会多一个进程,关闭的话都放在最小化栏目里面,经常排一排,都不知哪个是正在用的了

下载链接有误

SwitchHosts_mac_v0.2.1.1775.zip 这个不能下载,另外mac版怎么自己编译?

建议加入多级HOST继承关系

很简单,就像目录结构一样,下一级目录继承于上一级目录,其实就是通用HOST的增强版.为什么有这个需求?厄...因为提测发的是一个HOST,然后本机开发又是另外一套HOST,原本不冲突的,只是老是要手动把本机开发的HOST加到提测HOST里麻烦而已~但又不能放到通用HOST里去,要不然切换到正式环境(把所有HOST去掉)的时候更麻烦~~~这个嘛....可以做做看咯.

希望能支持复选框

当对hosts进行分类后,必然每个host文件只含有很少的指向。
而每个环境都需要加载几个分类好的host文件。
需要支持复选框,来运用同时几个文件。

功能实用性改进建议

开发者您好:
首先感谢你们做出这么实用的软件!
功能上我提一个个人的建议,首先切换方案存在一个问题,它是整个hosts换掉,但如果我只是想其中一部分的映射改掉,剩余的保留当前的映射,当前的设计就很难做到。我觉得这个功能做的好会很赞的.
谢谢.

提个搜索的需求

有时候host很多,我想看看当前有没有某条记录,弄个地方可以匹配下吧,实时过滤就行了。。

新版缺少一个保存当前系统hosts的功能

打开最新的v0.2版本,应用本地方案“方案一”,结果当前系统hosts的内容就没有了。而且找不回来了。希望至少加个提示让用户手动保存,或者最好做成自动保存的方式。

notify_notification_show: code should not be reached

3.2.0-59-generic #90-Ubuntu
(SwitchHosts.py:25494): libnotify-WARNING *: you must call notify_init() before showing
*

libnotify:ERROR:notification.c:568:notify_notification_show: code should not be reached
[1] 25494 abort python SwitchHosts.py
大概什么问题?我尝试更新了libnotify库和python-notify,无果.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.