Closed pauleveritt closed 8 years ago
I think it would be like adding another case in the switch
switch (messageType) {
case login:
// code
break;
case interactive:
//code
break;
case file:
//code
break;
case logout:
//code
break;
default:
break;
}
though if you think of a more elegant solution I would love to hear hahaha, since all of this stuff is new to me I'm still a bit lost on what to do or how to do ir properly. in these days i will do some rework on the implementation I made to fix some issues ben pointed and I will look into the file case you are mentioning
python-plugins
on the server's root directory, this is a working example of that.
This plugin was originally aimed at interactive usage. Which means it expects a connection input/output approach that is different than an editor:
https://github.com/Jycraft/jycraft/blob/master/src-common/jycraft/plugin/servers/PySFListener.java#L125
Meaning, it tries to keep reading, across messages, until it thinks you are "finished". This works well for telnet and for the interactive interpreter in the browser. But it's a pain when we want to send over a single chunk of code to execute.
We have added JSON support to the web socket version. Should we refactor this to let the browser tell the server when it is sending a full "file"?