I have been trying to connect remix to my machine and I have tried the following command:
remixd -s ./contracts --remix-ide http://remix.ethereum.org
Also, I have tried the https
and other combinations which are mentioned here
but, still I have not been able to connect to the remix and sometimes it shows me Connection from origin http://remix.ethereum.org rejected.
but sometimes it doesn't mention if it has been connected to the remix or not.
I have tried both the old and new version of remix but the problem persists on both.