npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

crossway

v1.0.0

Published

A simple CORS proxy server to bypass CORS restrictions

Readme

Crossway

A simple CORS proxy server to bypass browser CORS restrictions.

Introduction

Crossway is a lightweight proxy server that helps developers solve cross-origin resource sharing (CORS) restriction issues. When you try to access APIs from different domains in your frontend application, the browser's security policy will block these requests. By using this proxy server, you can easily bypass these restrictions.

Features

  • Bypass browser CORS restrictions
  • Support for all HTTP methods (GET, POST, PUT, DELETE, etc.)
  • Support for HTTPS target sites
  • Simple and easy-to-use API
  • Provides client-side fetch wrapper

Usage

Before using Crossway to solve cross-domain issues, you need to start the proxy server first. After starting, you can use this relay server to request resources from other domains in any frontend project.

You can start the server in two ways: either by downloading the project locally and starting it, or by installing the crossway package and starting it through programmatic calls.

Direct Server Startup

# Clone the project
git clone https://github.com/kirakiray/crossway
cd crossway

# Install dependencies
npm install

# Use default port 3000 and path "/"
npm start

# Or specify port and path
node index.js --port=30110 --path=/cors-proxy

Programmatically Create and Start Server

npm install crossway

You can also create and configure the CORS proxy server programmatically:

import { createCorsProxyServer } from "crossway/src/server.js";

// Create proxy server instance
const server = createCorsProxyServer({
  port: 30110,     // Server port, default is 3000
  path: "/cors-proxy"  // Server path prefix, default is "/"
});

// Start the server
server.listen(30110, () => {
  console.log("CORS Proxy server running on port 30110");
});

Sending Requests Through Proxy

1. Direct URL Usage

After starting the server, you can access the target URL in the following way:

http://localhost:30110/cors-proxy?url=https://api.example.com/data

2. Using the Provided Fetch Wrapper

You can choose to install the crossway package; or copy the fetch file from the crossway project's src directory to your project;

npm install crossway

The project provides a fetch wrapper that makes sending requests more convenient:

// import { fetch, config } from "./src/fetch.js";
import { fetch, config } from "crossway/src/fetch.js"; // Need to install crossway first

// Configure proxy server
config.port = 30110;
config.path = "/cors-proxy";

// Send request
const response = await fetch("https://api.example.com/data");
const data = await response.json();

Client Example

See the demo.html file for a complete usage example.

API Documentation

Server Endpoints

  • GET/POST/PUT/DELETE /[path]?url=[targetUrl]
    • path: Configured server path prefix
    • url: Target URL to proxy (needs to be URL encoded)

Response

The proxy server returns the response from the target URL with appropriate CORS headers:

Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
Access-Control-Allow-Headers: Content-Type, Authorization

Configuration Options

Command Line Arguments

  • -p, --port: Server port (default: 3000 or environment variable PORT)
  • -P, --path: Server path prefix (default: "/")

Environment Variables

  • PORT: Server port (default: 3000)

Development

Project Structure

crossway/
├── index.js          # Server entry point
├── demo.html         # Usage example
├── package.json      # Project configuration
├── LICENSE           # License file
├── .gitignore        # Git ignore file
├── md/
│   └── cn.md         # Chinese documentation
├── src/
│   ├── server.js     # Server core logic
│   └── fetch.js      # Client fetch wrapper
└── README.md         # Project documentation

Server Core Logic

The server processes requests through the following steps:

  1. Verify that the request path matches the configured path prefix
  2. Add CORS headers to the response
  3. Handle OPTIONS preflight requests
  4. Parse the target URL
  5. Make a request to the target server
  6. Forward the response to the client

License

This project is licensed under the Apache-2.0 License. See the LICENSE file for details.