HTTP / HTTPS Proxy in Purebasic

Just starting out? Need help? Post your questions and find answers here.
lisa_beille
User
User
Posts: 24
Joined: Fri Dec 22, 2023 5:59 pm

HTTP / HTTPS Proxy in Purebasic

Post by lisa_beille »

Hello

i'm currently developing an http(s) packet inspection tool (kind of burpsuite) and my main concern is about creating an http / https proxy in purebasic that can intercept requests, analyze them then forward them to their destination.

I tried some codes but i get confused and it doesn't work.

Does anyone have a minimalistic workig code ?

thanks
User avatar
NicTheQuick
Addict
Addict
Posts: 1523
Joined: Sun Jun 22, 2003 7:43 pm
Location: Germany, Saarbrücken
Contact:

Re: HTTP / HTTPS Proxy in Purebasic

Post by NicTheQuick »

Is your goal to do that by yourself to learn from or why do you not want to use already existing tools?
The most complicated part with that is going to be the SSL/TLS part because that's a huge field where you should better use existing libraries.
The english grammar is freeware, you can use it freely - But it's not Open Source, i.e. you can not change it or publish it in altered way.
lisa_beille
User
User
Posts: 24
Joined: Fri Dec 22, 2023 5:59 pm

Re: HTTP / HTTPS Proxy in Purebasic

Post by lisa_beille »

.
Last edited by lisa_beille on Fri Dec 22, 2023 6:30 pm, edited 1 time in total.
lisa_beille
User
User
Posts: 24
Joined: Fri Dec 22, 2023 5:59 pm

Re: HTTP / HTTPS Proxy in Purebasic

Post by lisa_beille »

NicTheQuick wrote: Fri Dec 22, 2023 6:10 pm Is your goal to do that by yourself to learn from or why do you not want to use already existing tools?
The most complicated part with that is going to be the SSL/TLS part because that's a huge field where you should better use existing libraries.
It would be great if I could do that by myself but what tools or libraries can I use that can be intergrated with PB ?
User avatar
NicTheQuick
Addict
Addict
Posts: 1523
Joined: Sun Jun 22, 2003 7:43 pm
Location: Germany, Saarbrücken
Contact:

Re: HTTP / HTTPS Proxy in Purebasic

Post by NicTheQuick »

You can basically use every library that also can be used by C.
The english grammar is freeware, you can use it freely - But it's not Open Source, i.e. you can not change it or publish it in altered way.
lisa_beille
User
User
Posts: 24
Joined: Fri Dec 22, 2023 5:59 pm

Re: HTTP / HTTPS Proxy in Purebasic

Post by lisa_beille »

NicTheQuick wrote: Fri Dec 22, 2023 6:31 pm You can basically use every library that also can be used by C.
can you suggest a good library ?
User avatar
NicTheQuick
Addict
Addict
Posts: 1523
Joined: Sun Jun 22, 2003 7:43 pm
Location: Germany, Saarbrücken
Contact:

Re: HTTP / HTTPS Proxy in Purebasic

Post by NicTheQuick »

On Linux I would suggest libssl I guess. But I don't do stuff like that with Purebasic because it's way to much effort if there are other languages that already have such things integrated natively. :wink:
The english grammar is freeware, you can use it freely - But it's not Open Source, i.e. you can not change it or publish it in altered way.
infratec
Always Here
Always Here
Posts: 7623
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: HTTP / HTTPS Proxy in Purebasic

Post by infratec »

lisa_beille
User
User
Posts: 24
Joined: Fri Dec 22, 2023 5:59 pm

Re: HTTP / HTTPS Proxy in Purebasic

Post by lisa_beille »

Thanks

Do you know any minimalistic code example for a proxy in PB ?
infratec
Always Here
Always Here
Posts: 7623
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: HTTP / HTTPS Proxy in Purebasic

Post by infratec »

There is no minimalistic example :wink:

Years ago I wrote a proxy for postgres to make secured access from PB to a postgres server.
It was very tricky and not easy to implement.

For normal http https I would use nginx as proxy.
User avatar
NicTheQuick
Addict
Addict
Posts: 1523
Joined: Sun Jun 22, 2003 7:43 pm
Location: Germany, Saarbrücken
Contact:

Re: HTTP / HTTPS Proxy in Purebasic

Post by NicTheQuick »

Proxying is not as easy as piping network traffic from one port to an other one. You have to parse and interpret the HTTP headers and change them accordingly. And with HTTPS you also have to match certificates and check them. It's really a complicated topic.

I am also not aware of any minimalistic example code since it is too complex to be minimalistic. :wink:

I also never did that by myself. I think there are enough ready to use applications that can be used for that.
The english grammar is freeware, you can use it freely - But it's not Open Source, i.e. you can not change it or publish it in altered way.
lisa_beille
User
User
Posts: 24
Joined: Fri Dec 22, 2023 5:59 pm

Re: HTTP / HTTPS Proxy in Purebasic

Post by lisa_beille »

NicTheQuick wrote: Sun Dec 24, 2023 11:15 am Proxying is not as easy as piping network traffic from one port to an other one. You have to parse and interpret the HTTP headers and change them accordingly. And with HTTPS you also have to match certificates and check them. It's really a complicated topic.

I am also not aware of any minimalistic example code since it is too complex to be minimalistic. :wink:

I also never did that by myself. I think there are enough ready to use applications that can be used for that.
then a minimal working example :D
lisa_beille
User
User
Posts: 24
Joined: Fri Dec 22, 2023 5:59 pm

Re: HTTP / HTTPS Proxy in Purebasic

Post by lisa_beille »

NicTheQuick wrote: Sun Dec 24, 2023 11:15 am Proxying is not as easy as piping network traffic from one port to an other one. You have to parse and interpret the HTTP headers and change them accordingly. And with HTTPS you also have to match certificates and check them. It's really a complicated topic.

I am also not aware of any minimalistic example code since it is too complex to be minimalistic. :wink:

I also never did that by myself. I think there are enough ready to use applications that can be used for that.
what is i use the httprequest purebasic function ?
DarkDragon
Addict
Addict
Posts: 2345
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Re: HTTP / HTTPS Proxy in Purebasic

Post by DarkDragon »

lisa_beille wrote: Sun Dec 31, 2023 7:13 pmwhat is i use the httprequest purebasic function ?
That's just a client, not a proxy.
bye,
Daniel
lisa_beille
User
User
Posts: 24
Joined: Fri Dec 22, 2023 5:59 pm

Re: HTTP / HTTPS Proxy in Purebasic

Post by lisa_beille »

DarkDragon wrote: Sun Dec 31, 2023 8:18 pm
lisa_beille wrote: Sun Dec 31, 2023 7:13 pmwhat is i use the httprequest purebasic function ?
That's just a client, not a proxy.
maybe i can forward the request with http request and then send back the reponse to client ?
Post Reply