How to make a proxy

Now before you go like “proxies are not allowed on Replit”, I never said I’m making a proxy on Replit.


So yeah, how do proxies work and how can I make one?
I might be making one on GitHub (if I learn how to use GitHub Pages)

1 Like

Maybe see this guide on how proxies work by @python660, which should give you a better idea on how to implement such things into your own proxy.


GitHub Pages will only work with static sites, and I would personally recommend a backend for something like this, if not all your projects.

I would still recommend using GitHub though, and possibly designing/testing through Codespaces. You may need to use an external service for hosting if you want to make your proxy public.

5 Likes

Yes, the explanation was useful, but HOW THE HELL AM I GONNA GET DATA FROM WEBSITES!?!?
(no offense if that “sounded” like yelling)
I need actual code examples so I can learn how to make a proxy.

4 Likes

btw @9pfs1 why did you give a laughing reaction to my post?

I’m not sure if this is allowed, plz don’t ban me, no harmful intentions!!
You need the following:

Code

Sources redacted

recieve http request => fetch website communicated somehow => send fetched website in the http response

Hosting

  • cyclic.sh
  • render.com
  • oracle cloud
  • etc ask others in the community
4 Likes

Which file of these proxies collects data from websites?
Please send me the link to da file that collects data from websites and then shows it

1 Like

check out L212-L217 (source redacted)

	async routeRequest(req: IncomingMessage, res: ServerResponse) {
		const request = new Request(new URL(req.url!, 'http://bare-server-node'), {
			method: req.method,
			body: nullMethod.includes(req.method || '') ? undefined : req,
			headers: req.headers as HeadersInit,
		}) as BareRequest;
3 Likes

I don’t think we should be helping people try to make a proxy here on Replit. Maybe try StackOverflow or something.

1 Like

Can’t vanilla JavaScript do this?
But whatever I’m gonna use NodeJS.

My brain:

expl

I didn’t understand any of that

That’s exactly why I’m not fit for a Backend developer
I’ve heard backend devs have more salary than frontend devs
I guess my career is going to be making databases

3 Likes

vanilla javascript can do this, but it wouldn’t bypass anything and would defeat the point of a proxy. Instead of directly visiting the website, you are visiting another website that embeds the target content in the browser.

1 Like

Actually, there is almost no way you are gonna be able to do this just vanilla JS, so you are gonna have to use Node and maybe express or something

3 Likes

Maybe I should make a collab?


that’s a good website for hosting NodeJS websites

I second this, I was getting a little skeptical after we started providing source code. Replit Ask is still affiliated with Replit enough that students may be able to come onto Ask and see this topic, fork the repo, and simply initiate some npm command, basically bypassing any filtering.

Edit: You could probably add us to a PM or discuss on AMC or something where that isnt really an issue

@QwertyQwerty88 could you unlist this?

2 Likes

yes, that is true. I guess we could either make this topic private (?) or redact the source code.

3 Likes

Wow I’m too lazy to do that. (oh nvm there was only one link :man_facepalming: )
Any TL4s who want to do that?
But whatever I’ll do it

3 Likes

They’re not not allowed, but they aren’t exactly allowed either.

Basically, if you’re using it to bypass firewalls or whatever, THEN it’s against the ToS. Otherwise, you’re “allowed” to make one on Replit. Now, no one can know for sure what someone’s intended use is. Sooo Replit will just give you that message for when you go against ToS, even if you’re technically not


Nah bro np bold all caps with two exclamation points is not yelling at all, you’re fine bro


If SnakeyKing asks, I guess.

3 Likes

Ok. I guess I’ll never make a proxy then.
(who cares, I’m not fit for a backend dev)


btw, whose post should I mark as solution?

What?? :laughing: :laughing: :laughing:

Whichever helped you most, I guess. I can close it (or add that closing timer that automatically pops up when you mark a solution.

2 Likes

Use axios or node fetch for node, and use requests for Python. Just convert the response body to text format and set the inner html of a document to the text.

2 Likes