smartlook / smartlook-relay-proxy

Smartlook Relay Proxy ⚡️
https://smartlook.com
MIT License
6 stars 4 forks source link

SSL not supported #283

Open CruzGil opened 1 week ago

CruzGil commented 1 week ago

Describe the bug This proxy does not support SSL connections. The npm project of smartlook convert all requests to "https". This ist not possible with this relay proxy.

If i want to download the recorder.js over https:

image

To Reproduce Steps to reproduce the behavior:

  1. Download something with https, for example: https://localhost:50566/recorder.js
  2. See error

Expected behavior I can use your npm smartlook-client and your proxy.

Screenshots

image
CruzGil commented 1 week ago

ok, i found the error myself and fixed it.

In your smartlook client, which is integrated via npm, there is an issue.

In line 107 in index.ts:

initParams.host = constructedUrl.host should be initParams.host = constructedUrl.origin

So it will return "http://localhost:50565" instead "localhost:50565".

This will make that code working correctly in your es6/init.30fa4f337832683ccad3.js file:

const o=new URL(/^https?:\/\//.test(r=e)?r:http://${r}`);var r;if(!t)return o;let i=o.pathname;return i.endsWith("/")&&t.startsWith("/")&&(i=i.slice(0,-1)),new URL(${i}${t},o.origin)},i=[/:\/\/10(.\w+){3}(:\w+)?\//,/:\/\/172.(16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31).\w+.\w+(:\w+)?\//,/:\/\/192.168(.\w+){2}(:\w+)?\//,/:\/\/localhost(:\w+)?\//,/:\/\/127.0.0.1(:\w+)?\//,/^file:\/{3}/],n=e=>i.some((t=>t.test(e)))},141:(e,t,o)=>{o.d(t,{NM:()=`