Skip to content

Latest commit

 

History

History
271 lines (198 loc) · 5.45 KB

ProtoSSChe.md

File metadata and controls

271 lines (198 loc) · 5.45 KB

Author: Zeta Ret
Basic ProtoSS Node.js Server

Simple printed server from ProtoSS Packages using XeltoSS synthesis

Requires: http, https, http2, fs
Version: 1.12.0
Date: 2019 - Today

required*

zetaret.node::ProtoSSChe

Properties

env Object
default {},

htserv http.Server
default created,

acceptAppRequests Boolean
default false,

apps Object
default {}, map of id to application method

cookieMethod Function
default null,

requestMethod Function
default null,

onErrorBody Function
default null,

onEndBody Function
default null,

dataJoin String
default null,

reqIdLength Number
default 31,

keepBufferPerContentType Object
default {},

requestBodyMethods Array
default null,

readRequestOnError Boolean
default true,

requestMiddleware Array
default [],

responseMiddleware Array
default [],

Methods

ProtoSSChe() : void
HTTP Server Constructor

return void

getAppRequest(http.IncomingMessage request) : http.ClientRequest|http.IncomingMessage
Read request.headers.protossappid

  • request* - http.IncomingMessage,

return http.ClientRequest|http.IncomingMessage, new or modified request object

onRequest(http.ClientRequest|http.IncomingMessage request, http.ServerResponse response) : void

  • request* - http.ClientRequest|http.IncomingMessage,
  • response* - http.ServerResponse,

return void

onReadRequestBody(http.ClientRequest|http.IncomingMessage request, String body, http.ServerResponse response) : ProtoSSChe

  • request* - http.ClientRequest|http.IncomingMessage,
  • body* - String,
  • response* - http.ServerResponse,

return ProtoSSChe

splitUrl(String url) : Object

  • url* - String,

return Object

rndstr(Number l) : String

  • l* - Number,

return String

getReqId() : String

return String

pushProtoSSResponse(http.ClientRequest|http.IncomingMessage request, http.ServerResponse response) : ProtoSSChe

  • request* - http.ClientRequest|http.IncomingMessage,
  • response* - http.ServerResponse,

return ProtoSSChe

readRequestBody(http.ClientRequest|http.IncomingMessage request, http.ServerResponse response) : ProtoSSChe

  • request* - http.ClientRequest|http.IncomingMessage,
  • response* - http.ServerResponse,

return ProtoSSChe

updateCookies(http.ClientRequest|http.IncomingMessage request, http.ServerResponse response, Object headers) : ProtoSSChe

  • request* - http.ClientRequest|http.IncomingMessage,
  • response* - http.ServerResponse,
  • headers* - Object,

return ProtoSSChe

endResponse(http.ClientRequest|http.IncomingMessage request, http.ServerResponse response) : ProtoSSChe

  • request* - http.ClientRequest|http.IncomingMessage,
  • response* - http.ServerResponse,

return ProtoSSChe

Static Properties

loadedModule Module
default external,

loadedModuleClass zetaret.node.ProtoSSChe
default extended,

serverclass zetaret.node.ProtoSSChe
default index,

serverche zetaret.node.ProtoSSChe
default new,

Static Protected Properties

env Object
default {},

dumpall Boolean
default false,

dumpkeys Array
default init,

omit Object
default init,

maxBodyLength Number
default 10000,

htport Number
default 8888,

reqnum Number
default 0,

contenttype String
default 'text/plain',

cookieid String
default 'zetaretpid',

sidinterval Number
default 5000,

sfile String
default 'stats.json',

useXServer Boolean
default false,

xserverModule String
default './modules/XProtoSSChe.js',

stats Object
default init, JSON Object loaded and updated frequently, use global.ProtoSSCheStatsFile to set different path in application before loading index module

{  
	reqnum:3, xserver:true, xserverModule: "./modules/MyServer.js", cookieid: "mycookie", htport: 3000, https: true,  
	httpsop: {keyPath, certPath, pfxPath, caPath, h2, ...anyOtherHTTPSOptionsParameter},  
	h2: false, h2op: null  
}  

Static Methods

setEnv(Object envobj) : void

  • envobj* - Object,

return void

resetFSInterval() : void

return void

stopFSInterval() : void

return void

getModuleInstance(String xmodule) : Object
create module server instance as it is by default, initiated once by loading the module using stats configuration and prepends global.ProtoSSCheXServerPath to xserverModule

  • xmodule - String, external path to server module

return Object, {serverche: ProtoSSChe, xpro: Module, xprocls: ProtoSSChe, xmodule: String}

Static Protected Methods

updateEnv() : void

return void

initFS() : void

return void