hi. i created a droidscript plugin who enable a ftp or sftp access to droidscript folder .
usage: create a droidscript app in ide :
function OnStart()
{
var servicejs=`
app.LoadPlugin("FtpServer");
var sftp;
function OnStart()
{
app.SetInForeground("SFTP","SFTP","","","high");
sftp = app.CreateFtpServer();
sftp.SetOnServerEvent(OnEvent);
sftp.SetProtocol("sftp");
sftp.SetAuth("user1", "pass1");
sftp.Start(2222);
// Notify user
app.ShowPopup("SFTP started on port 2222");
}
function OnMessage(msg)
{
if(msg == "stop") {
if(sftp) sftp.Stop();
app.StopService();
}
}
function OnEvent(status, msg)
{
// optional: notify main app
}
`;
app.WriteFile( "Service.js", servicejs );
lay = app.CreateLayout("linear", "VCenter,FillXY");
txt = app.CreateText( "", 0.4 );
txt.SetTextSize( 22 );
lay.AddChild( txt );
btn = app.CreateButton("Start SFTP", 0.5);
btn.SetOnTouch(function() {
svc = app.CreateService("this", "this", OnServiceReady,"Persist");
svc.SetOnMessage( OnServiceMessage );
});
lay.AddChild(btn);
btnStop = app.CreateButton("Stop SFTP", 0.5);
btnStop.SetOnTouch(function() {
if(svc) svc.SendMessage("stop");
});
lay.AddChild(btnStop);
app.AddLayout(lay);
}
function OnServiceReady()
{
txt.SetText("Service Ready");
}
function OnServiceMessage( msg )
{
txt.SetText( "Count: " + msg );
}
the run the app and press start SFTP.........
FTP dosent work to connect from same device......only from another device.....
sftp works from same device.....
check plugin samples docs....`
tested on : Android 16 Acode editor (very good editor) and in MAcOS VSCOE extension SFTP/FTP sync by Natizyskunk .......
the sftp server is alive while droidscript ide open.......after starting ftp server from app,you can exit that app and run another apss...it uses a service.......
On Saturday, April 18, 2026 at 2:06:58 PM UTC+3 Chisan Gelu wrote:
hi. i created a droidscript plugin who enable a ftp or sftp access to droidscript folder .
usage: create a droidscript app in ide :
function OnStart()
{
var servicejs=`
app.LoadPlugin("FtpServer");
var sftp;
function OnStart()
{
sftp = app.CreateFtpServer();
sftp.SetOnServerEvent(OnEvent);
sftp.SetProtocol("sftp");
sftp.SetAuth("user1", "pass1");
sftp.Start(2222);
// Notify user
app.ShowPopup("SFTP started on port 2222");
}
function OnMessage(msg)
{
if(msg == "stop") {
if(sftp) sftp.Stop();
app.StopService();
}
}
function OnEvent(status, msg)
{
// optional: notify main app
}
`;
app.WriteFile( "Service.js", servicejs );
lay = app.CreateLayout("linear", "VCenter,FillXY");
txt = app.CreateText( "", 0.4 );
txt.SetTextSize( 22 );
lay.AddChild( txt );
btn = app.CreateButton("Start SFTP", 0.5);
btn.SetOnTouch(function() {
svc = app.CreateService("this", "this", OnServiceReady);
svc.SetOnMessage( OnServiceMessage );
});
lay.AddChild(btn);
btnStop = app.CreateButton("Stop SFTP", 0.5);
btnStop.SetOnTouch(function() {
if(svc) svc.SendMessage("stop");
});
lay.AddChild(btnStop);
app.AddLayout(lay);
}
function OnServiceReady()
{
txt.SetText("Service Ready");
}
function OnServiceMessage( msg )
{
txt.SetText( "Count: " + msg );
}
the run the app and press start SFTP.........
FTP dosent work to connect from same device......only from another device.....
sftp works from same device.....
check plugin samples docs....`
tested on : Android 16 Acode editor (very good editor) and in MAcOS VSCOE extension SFTP/FTP sync by Natizyskunk .......
the sftp server is alive while droidscript ide open.......after starting ftp server from app,you can exit that app and run another apss...it uses a service.......