openbullet / OpenBullet2

OpenBullet reinvented
https://docs.openbullet.dev/
MIT License
1.76k stars 473 forks source link

[REQUEST] Keep underlying TCP stream open between multiple requests with same proxy and domain #733

Open Rpi-d opened 2 years ago

Rpi-d commented 2 years ago

Version of the software

0.2.4

Operating system

Windows

Browser / Native

Any

What happened?

When you use rotating proxies on one site, a new IP is taken for each request to the site. What about a persistent connection? Keep the connection alive

PS And I didn't find it anywhere, what is the AlwaysSendContent setting for?

Relevant LoliCode if needed

BLOCK:HttpRequest
  url = "https://api64.ipify.org?format=json"
  customHeaders = {("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36"), ("Pragma", "no-cache"), ("Accept", "*/*"), ("Accept-Language", "en-US,en;q=0.8"), ("Connection", "keep-alive")}
  TYPE:STANDARD
  $""
  "application/x-www-form-urlencoded"
ENDBLOCK

BLOCK:Parse
  input = @data.SOURCE
  jToken = "ip"
  MODE:Json
  => VAR @ip1
ENDBLOCK

BLOCK:HttpRequest
  url = "https://api64.ipify.org?format=json"
  customHeaders = {("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36"), ("Pragma", "no-cache"), ("Accept", "*/*"), ("Accept-Language", "en-US,en;q=0.8"), ("Connection", "keep-alive")}
  TYPE:STANDARD
  $""
  "application/x-www-form-urlencoded"
ENDBLOCK

BLOCK:Parse
  input = @data.SOURCE
  jToken = "ip"
  MODE:Json
  => VAR @ip2
ENDBLOCK

 data.Logger.Log($"ip1 ({ip1}) {(ip1 == ip2 ? "Equal To": "Not Equal To")} ip2 ({ip2})", LogColors.DarkOrchid);
openbullet commented 2 years ago

Connection reuse between different blocks is not implemented yet. It's something I plan to do sooner or later. The AlwaysSendContent setting is needed to send the content even if it's empty (it was the only way to let the request be accepted on some websites, but it's useless in 99.9% of cases).