• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
MagicMirror Forum
  • Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.

MMM-Hue CORS Policy Issue

Scheduled Pinned Locked Moved Solved Troubleshooting
28 Posts 7 Posters 8.0k Views 7 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    karsten13 @Fozi
    last edited by Jan 4, 2022, 8:39 PM

    @fozi thanks but … no

    would be better to have a solution without https, may someone else gets this figured out.

    As an improvement for the above solution with https:

    Holding the certs in the config directory makes them accessible from outside so better move them into a new directory beside config, e.g. certs which is not exposed. Don’t forget to update config.js afterwards.

    M 1 Reply Last reply Jan 5, 2022, 7:38 AM Reply Quote 1
    • M Offline
      mumblebaj Module Developer @karsten13
      last edited by Jan 5, 2022, 7:38 AM

      @karsten13 So I have been tinkering with the MMM-Hue module a bit and have replaced jQuery which seems to invoke XMLHttpRequest, with node-fetch, albeit the older version (2.6.1) of node-fetch, but it now returns data without requiring a certificate and the use of https.

      Check out my modules at: https://github.com/mumblebaj?tab=repositories

      M 1 Reply Last reply Jan 16, 2022, 6:48 PM Reply Quote 1
      • C Offline
        CarstenD
        last edited by Jan 9, 2022, 3:04 PM

        The same problem appears to happen with MMM-Homematic. Getting same errors after update to 2.18.0

        Access to XMLHttpRequest at 'http://192.168.178.xx/addons/xmlapi/state.cgi?datapoint_id=1824' from origin 'http://0.0.0.0:8080' has been blocked by CORS policy: The request client is not a secure context and the resource is in more-private address space private.
        
        K 1 Reply Last reply Jan 9, 2022, 3:07 PM Reply Quote 0
        • K Offline
          karsten13 @CarstenD
          last edited by Jan 9, 2022, 3:07 PM

          @carstend

          yes, was already reporty by @Fozi some posts above, MMM-Homematic uses jquery too.

          O 1 Reply Last reply Jan 15, 2022, 4:26 PM Reply Quote 0
          • O Offline
            OberfragGER @karsten13
            last edited by OberfragGER Jan 15, 2022, 4:42 PM Jan 15, 2022, 4:26 PM

            @karsten13 Its working now with:

            var config = 
            {
              electronOptions: {
            		webPreferences: {
            			webSecurity: false
            		}
            	},
              useHttps: true,
              httpsPrivateKey: "config/example.key",
              httpsCertificate: "config/example.crt",
              address: "localhost", 
              port: 8080,
            //  address: '0.0.0.0',
              ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.178.1/120", "192.168.178.100/24"],
              language: 'de',
              modules: [
            

            But with this setting, i have noc access the the RemoteControl-GUI and API also! ;(
            I really use it with my homeautomation to show/ hide modules.

            Is there another possibility?

            K 1 Reply Last reply Jan 15, 2022, 7:43 PM Reply Quote 0
            • K Offline
              karsten13 @OberfragGER
              last edited by Jan 15, 2022, 7:43 PM

              @oberfragger

              you must access the site with https, e.g. https://192.168.0.143:8080/remote.html

              O 1 Reply Last reply Jan 18, 2022, 2:45 PM Reply Quote 0
              • C Offline
                CarstenD
                last edited by Jan 16, 2022, 6:08 PM

                There is now a new version available for MMM-Homematic that also works w/o changing the config.

                S 1 Reply Last reply Apr 14, 2022, 7:47 AM Reply Quote 0
                • F Offline
                  Fozi Project Sponsor
                  last edited by Jan 16, 2022, 6:37 PM

                  @carstend Yeah, was just noted, too, about the update.
                  Some how I ran ino a problem when applying ‘git pull’, so I had to reinstall the module.
                  First the screen remained black. so I hat to install manually the ‘request’ library manually (see https://forum.magicmirror.builders/topic/15778/fix-for-black-screen-in-2-16-and-later). Now it works!

                  HowTo: Replace PIR Sensor with a RCWL-0516 Microwave Sensor

                  1 Reply Last reply Reply Quote 0
                  • M Offline
                    mumblebaj Module Developer @mumblebaj
                    last edited by Jan 16, 2022, 6:48 PM

                    @mumblebaj This is the new module I created. Does not require https.

                    https://github.com/mumblebaj/MMM-PhilipsHue.git

                    I am sure this will need to be changes once they enforce the headers stuff but for now it will work just fine.

                    Check out my modules at: https://github.com/mumblebaj?tab=repositories

                    1 Reply Last reply Reply Quote 0
                    • O Offline
                      OberfragGER @karsten13
                      last edited by OberfragGER Jan 18, 2022, 2:47 PM Jan 18, 2022, 2:45 PM

                      @karsten13 said in MMM-Hue CORS Policy Issue:

                      @oberfragger

                      you must access the site with https, e.g. https://192.168.0.143:8080/remote.html

                      Unfortunatly its not working via https. Still connection refused. I dint think that https://github.com/CatoAntonsen/MMM-MotionEye will update after 5 years.

                      K 1 Reply Last reply Jan 18, 2022, 5:45 PM Reply Quote 0
                      • 1
                      • 2
                      • 3
                      • 2 / 3
                      2 / 3
                      • First post
                        15/28
                        Last post
                      Enjoying MagicMirror? Please consider a donation!
                      MagicMirror created by Michael Teeuw.
                      Forum managed by Sam, technical setup by Karsten.
                      This forum is using NodeBB as its core | Contributors
                      Contact | Privacy Policy