Post Reply 
ProxHTTPSProxyMII: Development
Jul. 23, 2019, 05:34 PM (This post was last modified: Jul. 23, 2019 05:40 PM by vlad_s.)
Post: #245
RE: ProxHTTPSProxyMII: Development
After the changes in ProxyTool.py, the above listed sites work without changes. Does Privoxy support WebSocket? The developer’s response is rather vague. Here is what is recorded in the Privoxy log:
Code:
...
2019-07-23 20:14:15.328 7fe55effd700 Header: scan: GET http://tjournal.ru/chan/system HTTP/1.1
2019-07-23 20:14:15.329 7fe55effd700 Header: scan: Accept: */*
2019-07-23 20:14:15.329 7fe55effd700 Header: scan: Host: tjournal.ru
2019-07-23 20:14:15.329 7fe55effd700 Header: scan: User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:69.0) Gecko/20100101 Firefox/69.0
2019-07-23 20:14:15.329 7fe55effd700 Header: scan: Accept-Language: ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3
2019-07-23 20:14:15.329 7fe55effd700 Header: scan: Accept-Encoding: gzip, deflate, br
2019-07-23 20:14:15.329 7fe55effd700 Header: scan: Sec-WebSocket-Version: 13
2019-07-23 20:14:15.329 7fe55effd700 Header: scan: Origin: https://tjournal.ru
2019-07-23 20:14:15.329 7fe55effd700 Header: scan: Sec-WebSocket-Extensions: permessage-deflate
2019-07-23 20:14:15.329 7fe55effd700 Header: scan: Sec-WebSocket-Key: xLQdEBcAZbVdlHZTmiHG4g==
2019-07-23 20:14:15.329 7fe55effd700 Header: scan: Connection: keep-alive, Upgrade
2019-07-23 20:14:15.329 7fe55effd700 Header: scan: Cookie: pushVisitsCount=45;fingerprint=f794e8cfdfc384g67de; adblock-state=1; audio_
2019-07-23 20:14:15.329 7fe55effd700 Header: scan: Pragma: no-cache
2019-07-23 20:14:15.329 7fe55effd700 Header: scan: Cache-Control: no-cache
2019-07-23 20:14:15.329 7fe55effd700 Header: scan: Upgrade: websocket
2019-07-23 20:14:15.329 7fe55effd700 Header: scan: Tagged: ProxHTTPSProxyMII FrontProxy/v1.5 Python/3.7.3:397
2019-07-23 20:14:15.329 7fe56d32f700 Header: scan: GET http://static-osnova.gcdn.co/static/build/tjournal.ru/dropdown.7ed182cc2aa8236bff77.min.js HT
2019-07-23 20:14:15.329 7fe56d32f700 Header: scan: Accept: */*
2019-07-23 20:14:15.329 7fe56d32f700 Header: scan: Host: static-osnova.gcdn.co
...
2019-07-23 20:14:15.360 7fe55effd700 Header: Keeping the client header 'Connection: keep-alive, Upgrade' around. The server connection will be kept alive if possible.
...
2019-07-23 20:14:15.400 7fe55effd700 Header: scan: HTTP/1.1 101 Switching Protocols
2019-07-23 20:14:15.401 7fe55effd700 Header: scan: Server: nginx
2019-07-23 20:14:15.401 7fe55effd700 Header: scan: Date: Tue, 23 Jul 2019 17:14:15 GMT
2019-07-23 20:14:15.401 7fe55effd700 Header: scan: Content-Length: 0
2019-07-23 20:14:15.401 7fe55effd700 Header: scan: Connection: upgrade
2019-07-23 20:14:15.401 7fe55effd700 Header: scan: Sec-WebSocket-Extensions: permessage-deflate
2019-07-23 20:14:15.401 7fe55effd700 Header: scan: Access-Control-Allow-Credentials: true
2019-07-23 20:14:15.401 7fe55effd700 Header: scan: Access-Control-Allow-Origin: https://tjournal.ru
2019-07-23 20:14:15.401 7fe55effd700 Header: scan: Sec-WebSocket-Accept: sGlz46w7kC9gyLQiIHLN6IA81u4=
2019-07-23 20:14:15.401 7fe55effd700 Header: scan: Upgrade: websocket
2019-07-23 20:14:15.401 7fe55effd700 Header: scan: Strict-Transport-Security: max-age=31536000; preload
2019-07-23 20:14:15.401 7fe55effd700 Header: scan: X-XSS-Protection: 1; mode=block
2019-07-23 20:14:15.401 7fe55effd700 Header: scan: X-Content-Type-Options: nosniff
2019-07-23 20:14:15.401 7fe55effd700 Header: scan: Referrer-Policy: origin
2019-07-23 20:14:15.401 7fe55effd700 Header: scan: Content-Security-Policy: default-src * data: 'unsafe-eval' 'unsafe-inline'
2019-07-23 20:14:15.406 7fe55effd700 Header: Adding: Proxy-Connection: keep-alive
...

What I changed in ProxyTool.py to avoid misunderstandings was:
Code:
except (ssl.SSLEOFError, ssl.SSLError) as e:
            logger.error(Fore.RED + Style.BRIGHT + "[SSLError]")
            self.send_error(417, message="Exception %s" % str(e.__class__), explain=str(e))

    def purge_headers(self, headers):
        "Remove hop-by-hop headers that shouldn't pass through a Proxy"
        for name in ["Connection", "Keep-Alive", "Upgrade",
                     "Proxy-Connection", "Proxy-Authenticate"]:
            del headers[name]

    def purge_write_headers(self, headers):
        self.purge_headers(headers)
        for key, value in headers.items():
            self.send_header(key, value)
        self.end_headers()

changes:
Code:
except (ssl.SSLEOFError, ssl.SSLError) as e:
            logger.error(Fore.RED + Style.BRIGHT + "[SSLError]")
            self.send_error(417, message="Exception %s" % str(e.__class__), explain=str(e))

    def purge_headers(self, headers):
        "Remove hop-by-hop headers that shouldn't pass through a Proxy"
        for name in [""]:
            del headers[name]

    def purge_write_headers(self, headers):
        self.purge_headers(headers)
        for key, value in headers.items():
            self.send_header(key, value)
        self.end_headers()
235 line.
Add Thank You Quote this message in a reply
Post Reply 


Messages In This Thread
ProxHTTPSProxyMII: Development - whenever - May. 28, 2014, 03:13 AM
RE: ProxHTTPSProxyMII: Development - GunGunGun - Jan. 11, 2015, 10:38 AM
RE: ProxHTTPSProxyMII: Development - whenever - Jan. 14, 2015, 09:27 AM
RE: ProxHTTPSProxyMII: Development - JJoe - Jan. 14, 2015, 05:59 PM
RE: ProxHTTPSProxyMII: Development - whenever - Jan. 15, 2015, 01:47 AM
RE: ProxHTTPSProxyMII: Development - soccerfan - Jan. 19, 2015, 08:19 PM
RE: ProxHTTPSProxyMII: Development - GunGunGun - Jan. 15, 2015, 07:36 AM
RE: ProxHTTPSProxyMII: Development - whenever - Jan. 15, 2015, 10:05 AM
RE: ProxHTTPSProxyMII: Development - GunGunGun - Jan. 15, 2015, 01:22 PM
RE: ProxHTTPSProxyMII: Development - whenever - Jan. 16, 2015, 02:38 AM
RE: ProxHTTPSProxyMII: Development - JJoe - Mar. 30, 2015, 02:55 AM
RE: ProxHTTPSProxyMII: Development - whenever - Mar. 30, 2015, 07:22 AM
RE: ProxHTTPSProxyMII: Development - GunGunGun - Apr. 18, 2015, 03:44 AM
RE: ProxHTTPSProxyMII: Development - JJoe - Apr. 18, 2015, 04:08 AM
RE: ProxHTTPSProxyMII: Development - GunGunGun - Apr. 18, 2015, 05:22 AM
RE: ProxHTTPSProxyMII: Development - whenever - Oct. 01, 2015, 08:04 AM
RE: ProxHTTPSProxyMII: Development - Faxopita - Oct. 03, 2015, 11:03 AM
RE: ProxHTTPSProxyMII: Development - whenever - Oct. 04, 2015, 02:38 AM
RE: ProxHTTPSProxyMII: Development - kik0s - Oct. 10, 2015, 03:00 PM
RE: ProxHTTPSProxyMII: Development - whenever - Oct. 15, 2015, 03:05 AM
RE: ProxHTTPSProxyMII: Development - whenever - Oct. 21, 2015, 09:23 AM
RE: ProxHTTPSProxyMII: Development - whenever - Oct. 22, 2015, 03:37 AM
RE: ProxHTTPSProxyMII: Development - whenever - Oct. 23, 2015, 08:18 AM
RE: ProxHTTPSProxyMII: Development - Faxopita - Nov. 09, 2015, 06:03 PM
RE: ProxHTTPSProxyMII: Development - whenever - Nov. 10, 2015, 01:59 AM
RE: ProxHTTPSProxyMII: Development - Faxopita - Nov. 10, 2015, 07:02 PM
RE: ProxHTTPSProxyMII: Development - whenever - Nov. 11, 2015, 07:44 AM
RE: ProxHTTPSProxyMII: Development - Faxopita - Nov. 12, 2015, 07:12 PM
RE: ProxHTTPSProxyMII: Development - kik0s - Nov. 16, 2015, 10:12 PM
RE: ProxHTTPSProxyMII: Development - kik0s - Dec. 10, 2015, 11:43 PM
RE: ProxHTTPSProxyMII: Development - whenever - Dec. 22, 2015, 09:23 AM
RE: ProxHTTPSProxyMII: Development - kik0s - Dec. 22, 2015, 11:48 AM
RE: ProxHTTPSProxyMII: Development - rogern - Dec. 21, 2015, 08:59 AM
RE: ProxHTTPSProxyMII: Development - Faxopita - Dec. 22, 2015, 08:51 AM
RE: ProxHTTPSProxyMII: Development - whenever - Dec. 23, 2015, 02:08 AM
RE: ProxHTTPSProxyMII: Development - kik0s - Dec. 26, 2015, 03:16 PM
RE: ProxHTTPSProxyMII: Development - whenever - Dec. 30, 2015, 08:35 AM
RE: ProxHTTPSProxyMII: Development - kik0s - Jan. 12, 2016, 12:24 AM
RE: ProxHTTPSProxyMII: Development - Faxopita - Dec. 23, 2015, 02:20 PM
RE: ProxHTTPSProxyMII: Development - whenever - Dec. 25, 2015, 03:28 AM
RE: ProxHTTPSProxyMII: Development - Faxopita - Dec. 24, 2015, 01:23 PM
RE: ProxHTTPSProxyMII: Development - whenever - Jan. 12, 2016, 12:45 PM
RE: ProxHTTPSProxyMII: Development - soccerfan - Jan. 12, 2016, 06:09 PM
RE: ProxHTTPSProxyMII: Development - kik0s - Jan. 12, 2016, 11:15 PM
RE: ProxHTTPSProxyMII: Development - whenever - May. 16, 2016, 08:26 AM
RE: ProxHTTPSProxyMII: Development - kik0s - May. 16, 2016, 08:46 AM
RE: ProxHTTPSProxyMII: Development - whenever - May. 16, 2016, 01:45 PM
RE: ProxHTTPSProxyMII: Development - kik0s - May. 16, 2016, 02:22 PM
RE: ProxHTTPSProxyMII: Development - JJoe - Jan. 25, 2016, 12:09 AM
RE: ProxHTTPSProxyMII: Development - kik0s - Jan. 29, 2016, 07:03 PM
RE: ProxHTTPSProxyMII: Development - JJoe - Jan. 30, 2016, 12:57 AM
RE: ProxHTTPSProxyMII: Development - kik0s - May. 25, 2016, 01:12 AM
RE: ProxHTTPSProxyMII: Development - JJoe - May. 25, 2016, 03:26 PM
RE: ProxHTTPSProxyMII: Development - Faxopita - May. 25, 2016, 06:10 PM
RE: ProxHTTPSProxyMII: Development - kik0s - Jun. 09, 2016, 01:02 PM
RE: ProxHTTPSProxyMII: Development - JJoe - Jun. 25, 2016, 02:03 PM
RE: ProxHTTPSProxyMII: Development - kik0s - Jun. 17, 2016, 11:09 PM
RE: ProxHTTPSProxyMII: Development - JJoe - Jun. 25, 2016, 02:06 PM
RE: ProxHTTPSProxyMII: Development - kik0s - Jun. 28, 2016, 10:18 PM
RE: ProxHTTPSProxyMII: Development - whenever - Jul. 04, 2016, 07:04 AM
RE: ProxHTTPSProxyMII: Development - kik0s - Jul. 04, 2016, 02:14 PM
RE: ProxHTTPSProxyMII: Development - whenever - Jul. 05, 2016, 01:43 AM
RE: ProxHTTPSProxyMII: Development - kik0s - Jul. 05, 2016, 09:02 AM
RE: ProxHTTPSProxyMII: Development - Strykar - Aug. 25, 2016, 09:24 PM
RE: ProxHTTPSProxyMII: Development - kik0s - Sep. 12, 2016, 10:41 PM
RE: ProxHTTPSProxyMII: Development - JJoe - Sep. 13, 2016, 05:36 PM
RE: ProxHTTPSProxyMII: Development - Strykar - Sep. 14, 2016, 01:46 AM
RE: ProxHTTPSProxyMII: Development - Strykar - Sep. 14, 2016, 01:38 AM
RE: ProxHTTPSProxyMII: Development - kik0s - Sep. 16, 2016, 08:32 PM
RE: ProxHTTPSProxyMII: Development - JJoe - Sep. 16, 2016, 11:31 PM
RE: ProxHTTPSProxyMII: Development - kik0s - Sep. 19, 2016, 11:31 PM
RE: ProxHTTPSProxyMII: Development - JJoe - Apr. 19, 2018, 01:56 AM
RE: ProxHTTPSProxyMII: Development - JJoe - Apr. 21, 2018, 09:04 PM
RE: ProxHTTPSProxyMII: Development - JJoe - Jun. 17, 2018, 02:12 AM
RE: ProxHTTPSProxyMII: Development - vlad_s - Jul. 20, 2019, 06:48 PM
RE: ProxHTTPSProxyMII: Development - JJoe - Jul. 22, 2019, 02:12 AM
RE: ProxHTTPSProxyMII: Development - vlad_s - Jul. 22, 2019, 07:04 PM
RE: ProxHTTPSProxyMII: Development - JJoe - Jul. 23, 2019, 06:08 AM
RE: ProxHTTPSProxyMII: Development - amy - Jul. 23, 2019, 12:03 PM
RE: ProxHTTPSProxyMII: Development - vlad_s - Jul. 23, 2019 05:34 PM
RE: ProxHTTPSProxyMII: Development - vlad_s - Jul. 26, 2019, 10:16 PM
RE: ProxHTTPSProxyMII: Development - amy - Sep. 16, 2019, 03:01 AM
RE: ProxHTTPSProxyMII: Development - vlad_s - Sep. 12, 2019, 08:24 PM
RE: ProxHTTPSProxyMII: Development - JJoe - Sep. 15, 2019, 01:22 AM
RE: ProxHTTPSProxyMII: Development - vlad_s - Sep. 21, 2019, 07:14 PM
RE: ProxHTTPSProxyMII: Development - JJoe - Sep. 25, 2019, 03:49 AM
RE: ProxHTTPSProxyMII: Development - vlad_s - Sep. 25, 2019, 08:25 PM
RE: ProxHTTPSProxyMII: Development - JJoe - Sep. 26, 2019, 02:44 AM
RE: ProxHTTPSProxyMII: Development - vlad_s - Sep. 26, 2019, 05:25 PM
RE: ProxHTTPSProxyMII: Development - vlad_s - Sep. 26, 2019, 05:54 PM
RE: ProxHTTPSProxyMII: Development - vlad_s - Jun. 14, 2020, 09:37 PM
RE: ProxHTTPSProxyMII: Reloaded - JJoe - Dec. 30, 2014, 09:25 PM
RE: ProxHTTPSProxyMII: Reloaded - GunGunGun - Dec. 31, 2014, 04:30 AM
RE: ProxHTTPSProxyMII: Reloaded - whenever - Jan. 04, 2015, 02:51 AM
RE: ProxHTTPSProxyMII: Reloaded - GunGunGun - Jan. 10, 2015, 09:31 AM
RE: ProxHTTPSProxyMII: Development - whenever - Jan. 11, 2015, 08:26 AM
RE: ProxHTTPSProxyMII: Reloaded - JJoe - Jan. 10, 2015, 04:50 PM
RE: ProxHTTPSProxyMII: Reloaded - GunGunGun - Jan. 10, 2015, 05:56 PM

Forum Jump: