Last active
August 29, 2015 14:21
-
-
Save skial/14f9c4e1aac49ce2df96 to your computer and use it in GitHub Desktop.
Official Haxe NodeJS Type Definitions - example from https://github.com/HaxeFoundation/hxnodejs used in http://haxe.io/releases/3.2.0/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-lib hxnodejs | |
-js Main.js | |
-main Main |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package; | |
import js.node.Net; | |
class Main { | |
static function main() { | |
var server = Net.createServer(function(socket) { | |
socket.write("Echo server\n\n"); | |
socket.pipe(socket); | |
}); | |
server.listen(1337, "127.0.0.1"); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function (console) { "use strict"; | |
var Main = function() { }; | |
Main.main = function() { | |
var server = js_node_Net.createServer(function(socket) { | |
socket.write("Echo server\n\n"); | |
socket.pipe(socket); | |
}); | |
server.listen(1337,"127.0.0.1"); | |
}; | |
var js_node_Net = require("net"); | |
Main.main(); | |
})(typeof console != "undefined" ? console : {log:function(){}}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment