HTTP / HTTPS Proxy in Purebasic
-
- User
- Posts: 24
- Joined: Fri Dec 22, 2023 5:59 pm
HTTP / HTTPS Proxy in Purebasic
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
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
- NicTheQuick
- Addict
- Posts: 1523
- Joined: Sun Jun 22, 2003 7:43 pm
- Location: Germany, Saarbrücken
- Contact:
Re: HTTP / HTTPS Proxy in Purebasic
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 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.
-
- User
- Posts: 24
- Joined: Fri Dec 22, 2023 5:59 pm
Re: HTTP / HTTPS Proxy in Purebasic
.
Last edited by lisa_beille on Fri Dec 22, 2023 6:30 pm, edited 1 time in total.
-
- User
- Posts: 24
- Joined: Fri Dec 22, 2023 5:59 pm
Re: HTTP / HTTPS Proxy in Purebasic
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 ?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.
- NicTheQuick
- Addict
- Posts: 1523
- Joined: Sun Jun 22, 2003 7:43 pm
- Location: Germany, Saarbrücken
- Contact:
Re: HTTP / HTTPS Proxy in Purebasic
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.
-
- User
- Posts: 24
- Joined: Fri Dec 22, 2023 5:59 pm
Re: HTTP / HTTPS Proxy in Purebasic
can you suggest a good library ?NicTheQuick wrote: Fri Dec 22, 2023 6:31 pm You can basically use every library that also can be used by C.
- NicTheQuick
- Addict
- Posts: 1523
- Joined: Sun Jun 22, 2003 7:43 pm
- Location: Germany, Saarbrücken
- Contact:
Re: HTTP / HTTPS Proxy in Purebasic
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. 

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.
-
- User
- Posts: 24
- Joined: Fri Dec 22, 2023 5:59 pm
Re: HTTP / HTTPS Proxy in Purebasic
Thanks
Do you know any minimalistic code example for a proxy in PB ?
Re: HTTP / HTTPS Proxy in Purebasic
There is no minimalistic example
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.

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.
- NicTheQuick
- Addict
- Posts: 1523
- Joined: Sun Jun 22, 2003 7:43 pm
- Location: Germany, Saarbrücken
- Contact:
Re: HTTP / HTTPS Proxy in Purebasic
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.
I also never did that by myself. I think there are enough ready to use applications that can be used for that.
I am also not aware of any minimalistic example code since it is too complex to be minimalistic.

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.
-
- User
- Posts: 24
- Joined: Fri Dec 22, 2023 5:59 pm
Re: HTTP / HTTPS Proxy in Purebasic
then a minimal working exampleNicTheQuick 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.![]()
I also never did that by myself. I think there are enough ready to use applications that can be used for that.

-
- User
- Posts: 24
- Joined: Fri Dec 22, 2023 5:59 pm
Re: HTTP / HTTPS Proxy in Purebasic
what is i use the httprequest purebasic function ?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.![]()
I also never did that by myself. I think there are enough ready to use applications that can be used for that.
-
- Addict
- Posts: 2345
- Joined: Mon Jun 02, 2003 9:16 am
- Location: Germany
- Contact:
-
- User
- Posts: 24
- Joined: Fri Dec 22, 2023 5:59 pm
Re: HTTP / HTTPS Proxy in Purebasic
maybe i can forward the request with http request and then send back the reponse to client ?