Code Monkey home page Code Monkey logo

Comments (6)

coderaiser avatar coderaiser commented on May 19, 2024

Thank you, I will think about it. Which version of Cloud Commander and socket.io you use?

from cloudcmd.

brianmcmichael avatar brianmcmichael commented on May 19, 2024

cloudcmd 5.0.15
socket.io 1.4.5

Here's how the folders are structured on the system.

bmcmichael@websvcs02:~/ood_dev/cloudcmd$ ll
total 16
drwxr-xr-x 3 bmcmichael appl 4096 Feb 11 12:14 ./
drwxr-xr-x 4 bmcmichael appl 4096 Feb 16 16:19 ../
-rw-r--r-- 1 bmcmichael appl  649 Feb 16 10:11 app.js
drwxr-xr-x 6 bmcmichael appl 4096 Feb 16 12:01 node_modules/

bmcmichael@websvcs02:~/ood_dev/cloudcmd$ tree -d -L 3
.
`-- node_modules
    |-- cloudcmd
    |   |-- bin
    |   |-- css
    |   |-- font
    |   |-- html
    |   |-- img
    |   |-- json
    |   |-- lib
    |   |-- man
    |   |-- modules
    |   |-- node_modules
    |   |-- shell
    |   |-- test
    |   `-- tmpl
    |-- express
    |   |-- lib
    |   `-- node_modules
    `-- socket.io
        |-- lib
        `-- node_modules

21 directories
bmcmichael@websvcs02:~/ood_dev/cloudcmd$

from cloudcmd.

coderaiser avatar coderaiser commented on May 19, 2024

You should add path on socket.io init with prefix you going to use like in lib/server.js.

Added this information to docs.

All this things made in this way to make prefixes work around all Cloud Commander's middleware.

from cloudcmd.

brianmcmichael avatar brianmcmichael commented on May 19, 2024

Thanks, I'll try that!

from cloudcmd.

brianmcmichael avatar brianmcmichael commented on May 19, 2024

I found the issue.

edit.js is using CloudCmd.PREFIX instead of the actual socket path.

socketPath: CloudCmd.PREFIX

I am able to fix this by manually eding the socketPath var to my socket path, ex. pun/dev/socket.io, but I am new to express and I haven't figured out how to get the Socket's path variable into the edit.js yet.

This also appears to be an issue in konsole.js

socketPath = CloudCmd.PREFIX;

Also, I'm not sure that the updates to the README.md regarding prefixing the path are correct. My app.js currently for the middleware app currently looks like:

socket = io.listen(server, {
  path: '/pun/dev/socket.io'
});

app.use(cloudcmd({
    socket: socket,                   /* used by Config, Edit (optional) and Console (required)   */
    config: {                         /* config data (optional)                                   */
      root: homeDir(),  
      prefix: '/pun/dev/cloudcmd',  /* base URL or function which returns base URL (optional)   */
    }
}));

from cloudcmd.

brianmcmichael avatar brianmcmichael commented on May 19, 2024

Disregard. I seem to have managed to fix it in the socket path. Thanks!!!

from cloudcmd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.