Skip to content

Commit

Permalink
feat(node): parse host param even if tls is enabled
Browse files Browse the repository at this point in the history
we don't give a shit about those goddamn proxy providers
  • Loading branch information
1715173329 authored Jan 24, 2024
1 parent c0aeec8 commit 0af7ebb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
10 changes: 3 additions & 7 deletions htdocs/luci-static/resources/view/homeproxy/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,7 @@ function parseShareLink(uri, features) {
config.grpc_servicename = params.get('serviceName');
break;
case 'ws':
/* We don't parse "host" param when TLS is enabled, as some providers are abusing it (host vs sni)
* config.ws_host = params.get('host') ? decodeURIComponent(params.get('host')) : null;
*/
config.ws_host = params.get('host') ? decodeURIComponent(params.get('host')) : null;
config.ws_path = params.get('path') ? decodeURIComponent(params.get('path')) : null;
if (config.ws_path && config.ws_path.includes('?ed=')) {
config.websocket_early_data_header = 'Sec-WebSocket-Protocol';
Expand Down Expand Up @@ -274,8 +272,7 @@ function parseShareLink(uri, features) {
}
break;
case 'ws':
/* We don't parse "host" param when TLS is enabled, as some providers are abusing it (host vs sni) */
config.ws_host = (config.tls !== '1' && params.get('host')) ? decodeURIComponent(params.get('host')) : null;
config.ws_host = params.get('host') ? decodeURIComponent(params.get('host')) : null;
config.ws_path = params.get('path') ? decodeURIComponent(params.get('path')) : null;
if (config.ws_path && config.ws_path.includes('?ed=')) {
config.websocket_early_data_header = 'Sec-WebSocket-Protocol';
Expand Down Expand Up @@ -332,8 +329,7 @@ function parseShareLink(uri, features) {
}
break;
case 'ws':
/* We don't parse "host" param when TLS is enabled, as some providers are abusing it (host vs sni) */
config.ws_host = (config.tls !== '1') ? uri.host : null;
config.ws_host = uri.host;
config.ws_path = uri.path;
if (config.ws_path && config.ws_path.includes('?ed=')) {
config.websocket_early_data_header = 'Sec-WebSocket-Protocol';
Expand Down
10 changes: 3 additions & 7 deletions root/etc/homeproxy/scripts/update_subscriptions.uc
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,7 @@ function parse_uri(uri) {
config.grpc_servicename = params.serviceName;
break;
case 'ws':
/* We don't parse "host" param when TLS is enabled, as some providers are abusing it (host vs sni)
* config.ws_host = params.host ? urldecode(params.host) : null;
*/
config.ws_host = params.host ? urldecode(params.host) : null;
config.ws_path = params.path ? urldecode(params.path) : null;
if (config.ws_path && match(config.ws_path, /\?ed=/)) {
config.websocket_early_data_header = 'Sec-WebSocket-Protocol';
Expand Down Expand Up @@ -344,8 +342,7 @@ function parse_uri(uri) {
}
break;
case 'ws':
/* We don't parse "host" param when TLS is enabled, as some providers are abusing it (host vs sni) */
config.ws_host = (config.tls !== '1' && params.host) ? urldecode(params.host) : null;
config.ws_host = params.host ? urldecode(params.host) : null;
config.ws_path = params.path ? urldecode(params.path) : null;
if (config.ws_path && match(config.ws_path, /\?ed=/)) {
config.websocket_early_data_header = 'Sec-WebSocket-Protocol';
Expand Down Expand Up @@ -420,8 +417,7 @@ function parse_uri(uri) {
}
break;
case 'ws':
/* We don't parse "host" param when TLS is enabled, as some providers are abusing it (host vs sni) */
config.ws_host = (config.tls !== '1') ? uri.host : null;
config.ws_host = uri.host;
config.ws_path = uri.path;
if (config.ws_path && match(config.ws_path, /\?ed=/)) {
config.websocket_early_data_header = 'Sec-WebSocket-Protocol';
Expand Down

0 comments on commit 0af7ebb

Please sign in to comment.