Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Abstract sf::Proxy  (Read 17317 times)

0 Members and 3 Guests are viewing this topic.

korczurekk

  • Full Member
  • ***
  • Posts: 150
    • View Profile
    • Email
Abstract sf::Proxy
« on: October 27, 2016, 02:39:02 pm »
Idea
- Abstract sf::Proxy;
- Simple implementation for widely used proxies (like those: https://incloak.com/proxy-list/), HTTP(s)/SOCKS 5 support out-of-the-box would be pretty nice;
- ::setProxy(const sf::Proxy&) methods in proper classes.

Use cases
Abstract sf::Proxy:
Allows programmer to implement more complicated proxies, that may not be used by big amount of people so there's no need to implement those in SFML.

Simple implementation for widely used proxies:
1. Can be used to forward connections through 'normal', popular proxies;
2. Sample of proper inheritance of sf::Proxy class.

::setProxy(const sf::Proxy&) methods in proper classes
You all most likely know why.  :D

Sooo… what do you think?

Mario

  • SFML Team
  • Hero Member
  • *****
  • Posts: 879
    • View Profile
Re: Abstract sf::Proxy
« Reply #1 on: October 29, 2016, 10:38:03 pm »
While it would certainly be nice to have, I'd also consider it too specific and complex to add to a generic (networking) API. There are tons of other possible additions that are most likely more useful to a bigger audience, yet simply not possible due to lack of time. I think even a pure and simple HTTP server would be more likely than a proxy, but there's a similar problem.

When does a multimedia program need a built-in proxy? The chances should be next to nil. So the more realistic approach would be using a standalone proxy library or implementation and extend that using SFML to fulfill whatever you have in mind.

korczurekk

  • Full Member
  • ***
  • Posts: 150
    • View Profile
    • Email
Re: Abstract sf::Proxy
« Reply #2 on: October 30, 2016, 05:32:52 pm »
I looked again at the source code and it actually appears to be quite easy, max 100-150 lines of code and no need to write setProxy method(s), are there chances, that a PullRequest adding proxy support would be accepted? If so, I could explain my point of view and idea of implementation, and then eventually write it.

Mario

  • SFML Team
  • Hero Member
  • *****
  • Posts: 879
    • View Profile
Re: Abstract sf::Proxy
« Reply #3 on: October 31, 2016, 04:05:50 pm »
If you need that functionality anyway, just create your own fork of SFML and add it. Once done you can always ask again (e.g. by bumping this thread) or creating a pull request. :)

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Abstract sf::Proxy
« Reply #4 on: October 31, 2016, 06:24:22 pm »
The main point that's missing for me is a concert use case, like what does "to implement more complicated proxies" even mean? What's a more complicated proxy?

Since you mentioned SOCKS, should SFML implement a server or a client or both?

What is that setProxy function part of?

What's an "Abstract sf::Proxy"?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

korczurekk

  • Full Member
  • ***
  • Posts: 150
    • View Profile
    • Email
Re: Abstract sf::Proxy
« Reply #5 on: October 31, 2016, 09:17:32 pm »
If you need that functionality anyway, just create your own fork of SFML and add it. Once done you can always ask again (e.g. by bumping this thread) or creating a pull request. :)
I thought about it, but after some time I would not get new SFML features, so it's not really good idea.

like what does "to implement more complicated proxies" even mean? What's a more complicated proxy?
A proxy that requires something more than one message at the beginning to keep it active and working properly.

Since you mentioned SOCKS, should SFML implement a server or a client or both?
Client, SFML (and C++) aren't good choice to write servers and no one would really write such thing using those two.

What is that setProxy function part of?
Any class that could connect through proxy, like sf::Http, sf::Ftp or sf::TcpSocket.

What's an "Abstract sf::Proxy"?
Abstract base class that would be inherited by sf::HttpProxy, sf::SockProxy etc.


Mario

  • SFML Team
  • Hero Member
  • *****
  • Posts: 879
    • View Profile
Re: Abstract sf::Proxy
« Reply #6 on: November 01, 2016, 10:19:44 am »
If you need that functionality anyway, just create your own fork of SFML and add it. Once done you can always ask again (e.g. by bumping this thread) or creating a pull request. :)
I thought about it, but after some time I would not get new SFML features, so it's not really good idea.
Except that isn't true. You could still just fetch changes from the official master using an alternative remote. All changes and fixes would be applied, you'd just have to fix occasional merge conflicts (if any; if you're adding stuff only rather than modifying existing files).

korczurekk

  • Full Member
  • ***
  • Posts: 150
    • View Profile
    • Email
Re: Abstract sf::Proxy
« Reply #7 on: November 01, 2016, 11:02:33 am »
If you need that functionality anyway, just create your own fork of SFML and add it. Once done you can always ask again (e.g. by bumping this thread) or creating a pull request. :)
I thought about it, but after some time I would not get new SFML features, so it's not really good idea.
Except that isn't true. You could still just fetch changes from the official master using an alternative remote. All changes and fixes would be applied, you'd just have to fix occasional merge conflicts (if any; if you're adding stuff only rather than modifying existing files).
I'd have to change all classes using network (not much, a few lines) so… well, I have probably no choice, so I just hope, that devs won't change too much in those classes soon.  ;D

bushjeann

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Abstract sf::Proxy
« Reply #8 on: December 08, 2021, 04:55:34 pm »
 In a nutshell, a proxy server, or simply a proxy, is a computer that acts as an intermediary between the user and the target server. First, the client connects to the proxy server and requests the desired resource on another server—for example, a mail or an Html page. The proxy either connects to the target server and retrieves the help or returns the resource from its cache. I use pirate bay because it is the most convenient proxy server and easy to use.
« Last Edit: December 26, 2021, 08:57:20 pm by bushjeann »