Fără Descriere

oldj 9060725a2a update capture.. 6 ani în urmă
.github 9edea78946 Update issue_template.md 7 ani în urmă
app c1a474b2ff some minor adjustments; 6 ani în urmă
app-ui c1a474b2ff some minor adjustments; 6 ani în urmă
assets 9060725a2a update capture.. 6 ani în urmă
screenshots 9060725a2a update capture.. 6 ani în urmă
scripts 98c614e505 add AppImage package for linux. 6 ani în urmă
test cb7da7e95a 保存时刷新初步实现。 8 ani în urmă
.babelrc 7c0c7ca145 update dependencies. 6 ani în urmă
.gitattributes 6aafc4e346 Update .gitattributes 8 ani în urmă
.gitignore 4ba0dc8918 Merge branch 'master' into develop 6 ani în urmă
License.md 20bfc2474e Create License.md 8 ani în urmă
README.md 35ecb42174 update README. 6 ani în urmă
README_cn.md 35ecb42174 update README. 6 ani în urmă
package-lock.json e70eaf3244 update dependencies and some UI improvements. 6 ani în urmă
package.json e70eaf3244 update dependencies and some UI improvements. 6 ani în urmă

README.md

SwitchHosts!

Homepage: https://oldj.github.io/SwitchHosts/

SwitchHosts! is an App for managing hosts file, it is based on Electron, React, Ant Design, CodeMirror, etc.

Screenshot

Capture

Features

  • Switch hosts quickly
  • Syntax highlight
  • Remote hosts
  • Switch from system tray
  • macOS only: Alfred workflow support

Install

Download

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

brew

On macOS you can install SwitchHosts! by brew cask:

brew cask install switchhosts

Thanks to @gobinathm and @iamybj for updating the brew cask version.

scoop

On Windows you can install SwitchHosts! by scoop:

scoop install switchhosts

Thanks to @batkiz for updating the scoop version.

Backup

SwitchHosts! stores data at ~/.SwitchHosts (Or folder .SwitchHosts under the current user's home path on Windows), the ~/.SwitchHosts/data.json contains data, while the ~/.SwitchHosts/prefereces.json contains preferences info.

Run and Build

Environment

  • Install Node.js
  • Change to the folder ./, run npm install to install dependented libraries
  • Change to the folder ./app, run npm install again

    npm install
    cd app && npm install && cd ..
    

Build and run

  • Change to the folder ./, run npm run dll to build common files
  • Change to the folder ./, run npm run build
  • Change to the folder ./, run npm start, the App should start

    # create dll file
    npm run dll
     
    # build
    npm run build
    
    # start
    npm start
    
    # or start in developer mode
    npm run dev
    

Package

  • It is recommended to use electron-builder for packaging.
  • Go to the ./ folder, run npm run make . The packaged file will be 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.

    # pack
    npm run make # the packed files will be in ./dist
    
    # or 
    npm run build-and-make
    

Copyright

SwitchHosts! is a free and open source software, it is released under the MIT license.