proof of concept to change socket.io path
in this version, socket.io path is /ssh/socket.io
This commit is contained in:
parent
341e61eb01
commit
63eedabbba
4 changed files with 30365 additions and 10 deletions
File diff suppressed because one or more lines are too long
|
|
@ -292,3 +292,5 @@ body, html {
|
|||
.dropup:hover .dropbtn {
|
||||
background-color: #3e8e41;
|
||||
}
|
||||
|
||||
/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJ3ZWJzc2gyLmNzcyIsInNvdXJjZVJvb3QiOiIifQ==*/
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
'use strict'
|
||||
|
||||
import * as io from 'socket.io-client'
|
||||
import io from 'socket.io-client'
|
||||
import * as Terminal from 'xterm/dist/xterm'
|
||||
import * as fit from 'xterm/dist/addons/fit/fit'
|
||||
import { library, dom } from '@fortawesome/fontawesome-svg-core'
|
||||
|
|
@ -19,7 +19,9 @@ var loggedData = false
|
|||
var allowreplay = false
|
||||
var allowreauth = false
|
||||
var sessionLog, sessionFooter, logDate, currentDate, myFile, errorExists
|
||||
var socket, termid // eslint-disable-line
|
||||
var termid // eslint-disable-line
|
||||
// change path here and in the /app/server/app.js line 115
|
||||
var socket = io({path: '/ssh/socket.io'})
|
||||
var term = new Terminal()
|
||||
// DOM properties
|
||||
var status = document.getElementById('status')
|
||||
|
|
@ -30,7 +32,6 @@ var terminalContainer = document.getElementById('terminal-container')
|
|||
term.open(terminalContainer)
|
||||
term.focus()
|
||||
term.fit()
|
||||
|
||||
window.addEventListener('resize', resizeScreen, false)
|
||||
|
||||
function resizeScreen () {
|
||||
|
|
@ -38,16 +39,21 @@ function resizeScreen () {
|
|||
socket.emit('resize', { cols: term.cols, rows: term.rows })
|
||||
}
|
||||
|
||||
if (document.location.pathname) {
|
||||
// this area seems unneccessary now, tested out in Chrome 77 - bill
|
||||
//
|
||||
/* if (document.location.pathname) {
|
||||
var parts = document.location.pathname.split('/')
|
||||
var base = parts.slice(0, parts.length - 1).join('/') + '/'
|
||||
var resource = base.substring(1) + 'socket.io'
|
||||
socket = io.connect(null, {
|
||||
var resource = base.substring(1) + '/ssh/socket.io'
|
||||
socket = io(null, {
|
||||
path: '/ssh/socket.io',
|
||||
resource: resource
|
||||
})
|
||||
// socket.connect()
|
||||
} else {
|
||||
socket = io.connect()
|
||||
}
|
||||
socket = io('http://localhost:2222', {path: '/ssh/socket.io'})
|
||||
// socket.connect()
|
||||
} */
|
||||
|
||||
term.on('data', function (data) {
|
||||
socket.emit('data', data)
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ var compression = require('compression')
|
|||
var server = require('http').Server(app)
|
||||
var myutil = require('./util')
|
||||
var validator = require('validator')
|
||||
var io = require('socket.io')(server, { serveClient: false })
|
||||
var io = require('socket.io')(server, { serveClient: false, path: '/ssh/socket.io' })
|
||||
var socket = require('./socket')
|
||||
var expressOptions = require('./expressOptions')
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue