Remote Control |
Version 1.0.0 (Sep 07, 2011) Matthieu Casanova <chocolat.mou@gmail.com> |
Introduction |
This plugin is a remote control for jEdit. It is used to open a remote api to control jEdit over the network. To be useful you will need an external application that will be the client.
The network protocol works over TCP, the default port is 53348. The data are text encoded in
UTF-8.
Using that protocol you will be able to send commands to jEdit (beanshell, invoke actions),
receive the result of your commands, and listen for EBMessage from EditBus.
The protocol is asynchronous, this mean that you can receive messages at any time, and that when you invoke
actions the action result will not be returned immediately (it is quick but you could receive other events
between your request and the response).
Before being able to send and receive messages, you have to identify you. It is the handshake, that is described next
The default mode. It uses a pincode that must be the same on jEdit and on your client. That code is never sent on the network and must be entered as a setting of your program and of the RemoteControl plugin. By default this pincode is 1234
When you connect, you have to send jEdit-RemoteServer-Hello\n
Immediately you will receive jEdit-RemoteServer-Welcome-Challenge-xxxx where xxxx is a random
text.
With that text you have to calculate the md5 of pincode+jEdit-RemoteServer-Welcome-Challenge-xxxx
for example
md5(1234jEdit-RemoteServer-Welcome-Challenge-xxxx).
then you return
jEdit-RemoteServer-Challenge-Answer-yyyyy where yyyyy is the md5 hash you just calculated.
If your hash is good, you will receive jEdit-RemoteServer-Welcome, otherwise the connection will be
closed
client RemoteControlPlugin | | | jEdit-RemoteServer-Hello | |---------------------------------------------->| | jEdit-RemoteServer-Welcome-Challenge-xxxx | |<----------------------------------------------| | jEdit-RemoteServer-Challenge-Answer-yyyyy | |---------------------------------------------->| | jEdit-RemoteServer-Welcome | |<----------------------------------------------|
client RemoteControlPlugin | | | jEdit-RemoteServer-Hello | |---------------------------------------------->| | jEdit-RemoteServer-Welcome | |<----------------------------------------------|
Please report bugs to the bug jEdit's plugin tracker on sourceforge.net