Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

simple_proxy

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simple_proxy

  • 1.0.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source
Simple Proxy Logo

Simple Proxy


Build Status License: MIT Gem Version Downloads Documentation

Simple Proxy is a lightweight and easy-to-use proxy server built with Ruby, Sinatra, and HTTParty. It's designed to forward requests to specified target URLs, making it a versatile tool for developers working with APIs and web services.

Features

  • Supports GET, POST, and PUT HTTP methods.
  • Supports Cross-Origin Resource Sharing (CORS) with Sinatra::CrossOrigin.
  • Transfers headers and parameters to the target URL.
  • Provides mechanisms for starting and stopping the server.

Installation

To install Simple Proxy, you can add this line to your application's Gemfile:

gem 'simple_proxy'

and then execute:

bundle install

or simply install it from the command line:

gem install simple_proxy

Usage

To use Simple Proxy, you can require it in your application:

require 'simple_proxy'
Starting the Server

To start the server:

SimpleProxy.run!
Stopping the Server

To stop the server:

SimpleProxy.quit!
CLI

You can also start or stop the server from the command line:

simple_proxy start
simple_proxy stop
Proxying Requests

To proxy requests, you can use the '/proxy' endpoint:

get '/proxy' do
  SimpleProxy.proxy(params, request)
end
Making Proxy Requests

Once the server is running, you can make proxy requests to the following endpoints:

  • GET /proxy?url=target_url
  • POST /proxy?url=target_url
  • PUT /proxy?url=target_url
  • HEAD /proxy?url=target_url
  • DELETE /proxy?url=target_url

Replace target_url with the URL you want to proxy the request to.

Contributing

Contributions are welcome! Please read our Code of Conduct before contributing to help this project stay welcoming.

  • Fork it (https://github.com/Hetu-Labs/simple_proxy/fork)
  • Create your feature branch (git checkout -b feature/fooBar)
  • Commit your changes (git commit -am 'Add some fooBar')
  • Push to the branch (git push origin feature/fooBar)
  • Create a new Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Code of Conduct

Please note that this project is released with a Contributor Code of Conduct. By participating in this project, you agree to abide by its terms.

Changelog

For all notable changes made to this project, see the Changelog.

FAQs

Package last updated on 24 Sep 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc