GithubHelp home page GithubHelp logo

viva9grup / singet Goto Github PK

View Code? Open in Web Editor NEW

This project forked from miladrahimi/singet

0.0 0.0 0.0 55 KB

A simple web proxy that can fetch (get, download or stream) a single URL.

Shell 0.84% Go 90.58% Dockerfile 8.58%

singet's Introduction

Singet

Singet means single get. It's a simple web proxy to fetch (get, download, or stream) a single URL. It's written in the Go programming language.

How to use

After running, you can fetch a single URL this way:

[host]:[port]/?url=[url]

For example:

https://domain.com/?url=https://target.com/video.mp4

The proxy passes the request body and headers (HTTP method, referrer, auth, etc.) to the requested URL.

Base64 Encoding

If you want to use this proxy on a censored network, you might need to encode URLs. To do so, you can use the base64 parameter instead of the url like in this example:

// Using "url" parameter:
https://domain.com/?url=https://miladrahimi.com

// Using "base64" parameter:
https://domain.com/?base64=aHR0cHM6Ly9taWxhZHJhaGltaS5jb20=

Redirection

The requested URL might return an HTTP redirection response. In this case, the proxy behaves based on the r parameter or its default behavior when the parameter is not present. You can set this parameter this way:

[host]:[port]/?url=[url]&r=[value]

Default

When r parameter is default or missing, it returns the response without manipulation. For example, if the request was http://proxy.com/?url=https://google.com the response would be a standard redirection to https://www.google.com.

Follow

When r parameter is follow, it redirects through the proxy. For example, if the request was http://proxy.com/?r=follow&url=https://google.com the response would be a redirection to http://proxy.com/?r=follow&url=https://www.google.com.

Stop

When r parameter is stop, it returns a JSON response contains the new location. For example, if the request was http://proxy.com/?r=stop&url=https://google.com the response would be:

HTTP/1.1 200 OK
Content-Type: application/json
...

{"location":"https://www.google.com/"}

HTTP Header Manipulation

By default, Singet passes the request headers without any change. You may want to manipulate some HTTP headers. In this case, you can pass the related header in the query string with the prefix h__ like in the example below.

https://proxy.com/?url=https://www.google.com&h__referer=https://images.google.com

It will set the REFERER header to https://images.google.com.

License

Singet is initially created by Milad Rahimi and released under the MIT License.

singet's People

Contributors

miladrahimi 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.