Giter VIP home page Giter VIP logo

switchhosts's Introduction

SwitchHosts!

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

SwitchHosts! is an App for managing hosts file, it is based on Electron, React, and 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 and Zip

  • It is recommended to use electron-packager for packaging.

    # install electron-packager for use from cli
    npm install electron-packager -g
  • Go to the ./ folder, run npm run pack . 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 pack  # the packed files will be in ./dist
    
    # or pack for a special platform
    npm run pack-mac  # pack for macOS, the packed files will be in ./dist
    npm run pack-win  # pack for Windows, the packed files will be in ./dist
  • After packaging, you can make a zip file by running the following command.

    # zip
    npm run zip  # the zipped files will be in ./dist

Copyright

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

switchhosts's People

Contributors

oldj avatar charlestang avatar caffreysun avatar elfsundae avatar janosorcsik avatar stotem avatar fengyiway avatar clovernet avatar jiangbo212 avatar kant avatar xmader avatar codeyu avatar pangliang avatar

Watchers

 avatar  avatar

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.