summaryrefslogtreecommitdiffstats
path: root/server/lib/tftp.js
blob: 1e69b345f4b0cf35c16b9b8351bcc98e8b4853a6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
'use strict';

// This tftp server uses BAS port +1
var tftp_port = process.env.PORT;
tftp_port++;

var tftp = require('tftp');
var server = tftp.createServer({
    host: '192.52.3.91',
    port: tftp_port,
    root: './tftp',
    denyPut: true
});

server.on ('error', function (error){
	// Errors from the main socket
	console.error (error);
});

server.on ('request', function (req){
	req.on ('error', function (error){
		// Error from the request
		console.error (error);
	});
});

server.listen();