Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cant input anything #11

Closed
metaspartan opened this issue Jun 28, 2020 · 4 comments
Closed

Cant input anything #11

metaspartan opened this issue Jun 28, 2020 · 4 comments

Comments

@metaspartan
Copy link

So I can't input anything, no console errors or console output on server...

Basically blank terminal with pointer and nothing happens when typing in it etc., when I shut down my server, it does display terminal disconnected...

I am using Gritty as middleware in an express app,

Server

const httpt = require('http');
const iot = require('socket.io');
const servert = httpt.createServer(app);
const sockett = iot.listen(servert);
 
const portt = 3337;
const ipt = '0.0.0.0';

app.use(gritty());

gritty.listen(sockett, {
  prefix: '/gritty'
});

servert.listen(portt, ipt);

Client

.gritty
        //- #terminal
        script.
          const options = {
              prefix: '/gritty',
              autoRestart: true, // optional
              env: {
                  TERMINAL: 'gritty',
              }
          };
          
          gritty('.gritty', options);
@coderaiser
Copy link
Member

I can't reproduce this, do you have any errors in console of your browser? What browser do you use? Is it latest version?

@metaspartan
Copy link
Author

I can't reproduce this, do you have any errors in console of your browser? What browser do you use? Is it latest version?

Yes, yes and yes. Chrome latest v83+

I have it working now, however I found it it is some kind of conflict with ports and using it as middleware with gritty.listen, I can't get gritty to run on the same port as my express/socket io server, like in my browser urls are typically :3000, then socket.io server is running on 3300, so for my terminal page I have to go to 3300 to have it load otherwise on 3000 it doesnt load and no errors. Any ideas to get it running on the same express port/socket.io port?

const app = express();

const server = require('http').Server(app);
const io = require('socket.io')(server);

gritty.listen(io, {
  prefix: '/gritty',
});


@coderaiser
Copy link
Member

I can't reproduce this, isn't example not works:

const gritty = require('gritty');
const http = require('http');
const express = require('express');
const io = require('socket.io');

const app = express();
const server = http.createServer(app);
const socket = io.listen(server);

const port = 1337;
const ip = '0.0.0.0';

app.use(gritty())
app.use(express.static(__dirname));

gritty.listen(socket, {
    command: 'mc',      // optional
    autoRestart: true,  // default
});

server.listen(port, ip);

@metaspartan
Copy link
Author

Wanted to update you that I got this working, I am now trying to get it to work with latest Electron, attempted swapping out node-pty for node-pty-prebuilt-multiarch but still getting a NODE VERSION mismatch, awesome terminal!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants