-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcreate_server.py
More file actions
1 lines (1 loc) · 846 Bytes
/
create_server.py
File metadata and controls
1 lines (1 loc) · 846 Bytes
1
content = '''const http=require('http');const fs=require('fs');const path=require('path');const root=process.cwd();const port=8000;const server=http.createServer((req,res)=,'same-origin');res.setHeader('Cross-Origin-Embedder-Policy','require-corp');res.setHeader('Content-Security-Policy',"default-src 'self';script-src 'self'https://cjrtnc.leaningtech.com;connect-src 'self';img-src 'self'data:;style-src 'self''unsafe-inline'");let url=req.url.split('?')[0];let filePath=path.join(root,url==='/'?'STARSECTOR_V6J_FINAL_WORKING.html':url);fs.readFile(filePath,{encoding:'utf8'},(e,c)=;res.end('Not found')}else{res.writeHead(200,{'Content-Type':path.extname(filePath)==='.js'?'text/javascript':'text/html'});res.end(c,'utf8')}})});server.listen(port,'0.0.0.0',()= server: http://localhost:'+port)});''';import sys;sys.stdout.set_encoding('utf-8')