JSCAD User Group

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    proxyUrl setting

    General Discussions
    3
    14
    1230
    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.
    • H
      hamade last edited by

      @hrgdavor
      Thank you for your reply.
      I have got what we want.
      What a beginner, the problem was the suffix of "remote.pl".
      When I changed to .cgi, it works.

      Thank you for your support.

      Founder of FabLab Shinagawa
      Director of hamanakadesignstudio LLC.

      z3dev 1 Reply Last reply Reply Quote 0
      • hrgdavor
        hrgdavor @hamade last edited by hrgdavor

        @hamade the error is exactly right πŸ™‚

        you have given an url that is not a script, it fails on syntax parsing.

        and if you take a look into network tab you will see why πŸ™‚

        you need to fix your proxy script and web server config so it returns js file that you expect instead of perl source of your proxy script.

        1 Reply Last reply Reply Quote 0
        • H
          hamade @hrgdavor last edited by

          @hrgdavor
          Thank you for your reply.
          I suppose there is no error showed in console.

          γ‚Ήγ‚―γƒͺγƒΌγƒ³γ‚·γƒ§γƒƒγƒˆ 2021-10-12 20.12.16.png

          The console says that :
          DevTools failed to load source map: Could not parse content for https://www.fablab-shinagawa.org/jscad/packages/web/drawer.css.map: Unexpected token < in JSON at position 0

          γ‚Ήγ‚―γƒͺγƒΌγƒ³γ‚·γƒ§γƒƒγƒˆ 2021-10-12 20.15.55.png

          Founder of FabLab Shinagawa
          Director of hamanakadesignstudio LLC.

          hrgdavor 1 Reply Last reply Reply Quote 0
          • hrgdavor
            hrgdavor last edited by

            please check browser network tab(it can be seen there why you get syntax error):

            also in network tab you can see the url that is called and if you open it in a diffferent tab:
            https://www.fablab-shinagawa.org/jscad/packages/web/remote.pl?url=https://fablab-shinagawa.org/jscad/designs/canHolder.js

            it looks like your perl script is not executed. You need to cofigure web server to run it instead treating as static asset πŸ™‚

            H 1 Reply Last reply Reply Quote 0
            • H
              hamade @hrgdavor last edited by

              @hrgdavor
              Thank you for your reply.
              I think, it might be caused not by CORS matter.
              Because when I am accessing from the same server, there still shows error message like this (Accessed URL: https://www.fablab-shinagawa.org/jscad/packages/web/index.html#https://fablab-shinagawa.org/jscad/designs/canHolder.js) :

              ERROR:
              Unexpected token # in JSON at position 0
              Stack: SyntaxError: Unexpected token # in JSON at position 0

              Founder of FabLab Shinagawa
              Director of hamanakadesignstudio LLC.

              1 Reply Last reply Reply Quote 0
              • H
                hamade @z3dev last edited by

                @z3dev
                Thank you for your reply.
                My rental server supports PERL.
                I placed "remote.pl" file, and made "cache" folder in the same directory of "index.html". What is the permission setting of "cache" folder ?

                The URL you showed as not accessible, has to be :
                https://www.fablab-shinagawa.org/jscad/designs/petbottleOpener.js
                Modeling scripts has no problem.
                Please check this link :
                https://openjscad.xyz/#https://www.fablab-shinagawa.org/jscad/designs/petbottleOpener.js

                And I always have following error, when I put the link like :
                https://www.fablab-shinagawa.org/jscad/packages/web/index.html#https://www.fablab-shinagawa.org/jscad/designs/petbottleOpener.js

                ERROR:
                Unexpected token # in JSON at position 0
                Stack: SyntaxError: Unexpected token # in JSON at position 0

                Founder of FabLab Shinagawa
                Director of hamanakadesignstudio LLC.

                1 Reply Last reply Reply Quote 0
                • z3dev
                  z3dev @hamade last edited by

                  @hamade Those designs are not accessible.

                  https://www.fablab-shinagawa.org/designs/petbottleOpener.js

                  That URL needs to work, i.e. the file should download and show in the browser.

                  So, the webserver configuration is incorrect.

                  Here's an example...

                  https://openjscad.xyz/examples/core/colors/colorCube.js

                  H 1 Reply Last reply Reply Quote 0
                  • z3dev
                    z3dev @hamade last edited by

                    @hamade OK. Here's where to start...

                    The webserver must support PERL, as there's a PERL script that runs on the webserver. (I can assist if you are using Apache)

                    After configuring and testing the webserver, copy 'remote.pl' to the webserver, and move into the base directory of the jscad website.

                    We use...

                    /var/www/openjscad.xyz/public_html/remote.pl

                    In addition, a new directory needs to be created called 'cache'. The PERL script downloads files and puts the file into this directory.

                    1 Reply Last reply Reply Quote 0
                    • hrgdavor
                      hrgdavor @hamade last edited by

                      @hamade if you setup proper "Access-Control-Allow-Origin" header on your server when downloading https://fablab-shinagawa.org/jscad/designs/fruitsHolder.js you would be able to do it without proxy by direct fetch from js

                      this url would work then for my proto that has no proxy
                      https://3d.hrg.hr/jscad/three/threejscad2.html?uri=https://fablab-shinagawa.org/jscad/designs/fruitsHolder.js

                      for exampe if I put your script to gihtub as a gist it works
                      https://3d.hrg.hr/jscad/three/threejscad2.html?uri=https://gist.githubusercontent.com/hrgdavor/08e61d2014ed7b62078fa9106380f634/raw/815d639e16bfa4e88e65e2e50b6772bc17cab35a/fruit.js

                      H 1 Reply Last reply Reply Quote 0
                      • H
                        hamade last edited by

                        @z3dev
                        Thank you for your reply.
                        Actually, I do not need a 100% copy of the JSCAD website.
                        Just want to include JSCAD interface to existing website.
                        Instead of former question, I have been working on following URL, just with the necessary script :
                        https://fablab-shinagawa.org/jscad/

                        In this page, I edited the script temporary so that we are able to manipulate our modeling sources via help menu.

                        Anyway, I would like to know the process to activate using those URLs such as :
                        https://fablab-shinagawa.org/jscad/index.html#https://fablab-shinagawa.org/jscad/designs/fruitsHolder.js
                        without errors.

                        Thank you.

                        Founder of FabLab Shinagawa
                        Director of hamanakadesignstudio LLC.

                        hrgdavor z3dev 3 Replies Last reply Reply Quote 0
                        • z3dev
                          z3dev @hamade last edited by

                          @hamade welcome

                          FYI, you are the first person trying this, i.e. installing the full website.

                          This is going to take some extra steps because there's some setup for the website, as well as special files for making the website function properly.

                          Are you sure that a 100% copy of the JSCAD website is necessary?

                          1 Reply Last reply Reply Quote 0
                          • First post
                            Last post
                          Powered by NodeBB | Contributors