Repository navigation
Installation
UNCORS provides multiple installation methods to suit different development environments and preferences. Choose the method that best fits your workflow.
For macOS or Linux users with Homebrew installed:
brew install evg4b/tap/uncorsWindows users with Scoop:
scoop bucket add evg4b https://github.com/evg4b/scoop-bucket.git
scoop install evg4b/uncorsUNCORS can be installed as a Node.js package using your preferred package manager:
npm:
npm install uncors --save-devyarn:
yarn add uncors --devpnpm:
pnpm add -D uncorsDocker images are available on Docker Hub:
docker run -p 80:3000 evg4b/uncors --from 'http://local.github.com' --to 'https://github.com'For users of the Stew package manager:
stew install evg4b/uncorsPre-compiled binaries are available for all major platforms on the UNCORS releases page.
Installation steps:
- Download the appropriate binary for your operating system and architecture
- Extract the binary to your preferred location
- (Optional) Add the binary to your
PATHfor convenient access
Recommended installation paths:
-
Linux|macOS:
/usr/local/bin -
Windows: Add to a directory included in your system's
PATHenvironment variable
The binary is self-contained and can be executed from any location without additional dependencies.
Prerequisites:
Build instructions:
# Clone the repository
git clone https://github.com/evg4b/uncors.git
cd uncors
# Build and install
go install -tags releaseUNCORS works by mapping local domains to remote servers. To use UNCORS effectively, you need to configure your system's hosts file to resolve custom domain names to localhost.
The hosts file is a system file that maps hostnames to IP addresses. UNCORS listens on localhost and requires entries in your hosts file to route traffic through it.
1. Open the hosts file with root privileges:
sudo nano /etc/hostsOr use your preferred editor:
sudo vim /etc/hosts2. Add your domain mappings:
127.0.0.1 api.local
127.0.0.1 app.local
127.0.0.1 admin.local
3. Save and exit:
- In nano: Press
Ctrl+Oto save, thenCtrl+Xto exit - In vim: Press
Esc, type:wq, then pressEnter
4. Verify the configuration:
ping api.local
# Should respond from 127.0.0.1Quick one-liner:
echo "127.0.0.1 api.local" | sudo tee -a /etc/hosts1. Run Notepad as Administrator:
- Press
Winkey, type "Notepad" - Right-click on "Notepad" and select "Run as administrator"
2. Open the hosts file:
- In Notepad, click File → Open
- Navigate to:
C:\Windows\System32\drivers\etc - Change file filter from "Text Documents (.txt)" to "All Files (.*)"
- Select
hostsand click Open
3. Add your domain mappings:
127.0.0.1 api.local
127.0.0.1 app.local
127.0.0.1 admin.local
4. Save the file (File → Save). If you get an access denied error, ensure Notepad is running as Administrator.
5. Verify the configuration:
ping api.localShould respond from 127.0.0.1.
Run PowerShell as Administrator:
Add-Content -Path C:\Windows\System32\drivers\etc\hosts -Value "`n127.0.0.1 api.local"# API development
127.0.0.1 api.local
127.0.0.1 api.dev
127.0.0.1 local.api.com
# Frontend development
127.0.0.1 app.local
127.0.0.1 frontend.local
# Microservices
127.0.0.1 auth.local
127.0.0.1 users.local
127.0.0.1 payments.local
# Note: Hosts file does NOT support wildcards
# Each subdomain must be listed explicitly
127.0.0.1 sub1.local.com
127.0.0.1 sub2.local.com
Warning
The hosts file does not support wildcard entries like *.local.com. Each
subdomain must be listed individually. However, UNCORS configuration supports
named placeholder mappings (e.g., http://{name}.local.com:8080 →
https://{name}.example.com) for domains explicitly listed in your hosts file.
Changes not taking effect - flush DNS cache:
# macOS
sudo dscacheutil -flushcache && sudo killall -HUP mDNSResponder
# Linux (systemd)
sudo systemctl restart systemd-resolved# Windows
ipconfig /flushdnsPermission denied: Ensure you are running your editor with administrator/root privileges.
Ping fails or wrong IP: Check for typos, duplicate entries, extra
whitespace, and confirm you are using 127.0.0.1.
Browser not resolving domain:
- Chrome: Visit
chrome://net-internals/#dnsand click "Clear host cache" - Firefox: Restart the browser
- Safari: Close all windows and restart
Caution
Modifying the hosts file can affect your system's network behavior. Only add entries for domains you control or are using for local development. Never add entries for production domains you don't own.
Best practices:
- Use
.localor.devTLDs for development - Document your hosts file changes
- Remove entries when a project is finished
- Never commit hosts file changes to version control
Once your hosts file is configured:
- Create an UNCORS configuration file (see Configuration)
- Start UNCORS:
uncors --config .uncors.yaml - Access your mapped domains through your browser or API client