Sign inSign up

gregoshop/cors-anywhere

By gregoshop

•Updated about 2 months ago
Archived

RPC Proxy for Casper-Webclient RPC port queries

Image
Networking
Developer tools
Web servers
0

1.2K

gregoshop/cors-anywhere repository overview

This cors-anywhere Docker image is a proxy server designed to bypass CORS (Cross-Origin Resource Sharing) restrictions. It is used in conjunction with the Casper Web Client to allow the web client to make RPC calls to the Casper Blockchain without encountering CORS issues.

⁠How It Works

  • The Casper Web Client (running on port 8080) communicates with the cors-anywhere proxy server (running on port 11100) to send RPC requests to the Casper Blockchain.
  • The proxy server ensures that the requests are not blocked due to CORS policy restrictions by allowing specific origins (like http://localhost:8080 and http://localhost:4200).

⁠Usage

⁠Docker Command

To run the cors-anywhere image:

docker run -d --name cors-anywhere -p 11100:11100 gregoshop/cors-anywhere:latest
  • -d: Runs the container in detached mode.
  • --name cors-anywhere: Assigns a name to the container.
  • -p 11100:11100: Maps port 11100 of the container to port 11100 on your local machine.

Once running, the proxy server can be accessed at: http://localhost:11100

⁠Docker Compose Configuration

If you're using Docker Compose to run the full setup, the cors-anywhere image can be configured as follows:

services:
  cors-anywhere:
    image: gregoshop/cors-anywhere:latest
    container_name: cors-anywhere
    environment:
      PORT: 11100
      ORIGIN_WHITELIST: |
        http://localhost:8080,
        http://localhost:4200,
        http://127.0.0.1:8080,
        http://127.0.0.1:4200
    ports:
      - "11100:11100"
    networks:
      - casper-network
⁠Important Notes
  • The cors-anywhere image is essential for handling CORS restrictions when the Casper Web Client communicates with the Casper Blockchain.
  • The proxy listens on port 11100 and ensures that the web client (running on port 8080) can interact with the blockchain.

⁠Conclusion

This Docker image helps handle CORS issues and allows seamless communication between the Casper Web Client and the Casper Blockchain by proxying requests through port 11100.

Tag summary

Content type

Image

Digest

sha256:3262875fa…

Size

56.2 MB

Last updated

about 2 months ago

docker pull gregoshop/cors-anywhere