Advertisement
Guest User

Untitled

a guest
Jan 6th, 2018
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Haxe 3.41 KB | None | 0 0
  1. import haxe.Http;
  2.  
  3. class Server {
  4.     static function main() {
  5.         var req = new Http("https://some.url");
  6.        
  7.         req.onData = function(data) {
  8.             trace(data);
  9.         }
  10.        
  11.         req.onError = function(err) {
  12.             trace("error $err");
  13.         }
  14.        
  15.         req.onStatus = function(status) {
  16.             trace('status $status');
  17.         }
  18.        
  19.         req.request(false);
  20.  
  21.         while(true) {
  22.             Sys.sleep(.5);
  23.             trace('ho ho');
  24.         }
  25.     }
  26. }
  27.  
  28.  
  29. S:\Projects\Snip>haxe --run Server
  30. C:\HaxeToolkit\haxe\std/haxe/Http.hx:442: characters 4-9 : Https is only supported with -lib hxssl
  31. C:\HaxeToolkit\haxe\std/haxe/Http.hx:401: characters 2-28 : Called from
  32. Server.hx:16: characters 8-26 : Called from
  33. ?:1: characters 1048575-8796094070782 : Called from
  34. Aborted
  35.  
  36. S:\Projects\Snip>haxe --run Server -lib hxssl
  37. C:\HaxeToolkit\haxe\std/haxe/Http.hx:442: characters 4-9 : Https is only supported with -lib hxssl
  38. C:\HaxeToolkit\haxe\std/haxe/Http.hx:401: characters 2-28 : Called from
  39. Server.hx:16: characters 8-26 : Called from
  40. ?:1: characters 1048575-8796094070782 : Called from
  41. Aborted
  42.  
  43. S:\Projects\Snip>haxe -lib hxssl --run Server
  44. Error: Error: Library hxssl is not installed : run 'haxelib install hxssl'
  45.  
  46. S:\Projects\Snip>haxelib
  47. Haxe Library Manager 3.3.0 - (c)2006-2016 Haxe Foundation
  48.   Usage: haxelib [command] [options]
  49.   Basic
  50.     install   : install a given library, or all libraries from a hxml file
  51.     update    : update a single library (if given) or all installed libraries
  52.     remove    : remove a given library/version
  53.     list      : list all installed libraries
  54.     set       : set the current version for a library
  55.   Information
  56.     search    : list libraries matching a word
  57.     info      : list information on a given library
  58.     user      : list information on a given user
  59.     config    : print the repository path
  60.     path      : give paths to libraries
  61.     version   : print the currently used haxelib version
  62.     help      : display this list of options
  63.   Development
  64.     submit    : submit or update a library package
  65.    register  : register a new user
  66.     dev       : set the development directory for a given library
  67.     git       : use Git repository as library
  68.     hg        : use Mercurial (hg) repository as library
  69.   Miscellaneous
  70.     setup     : set the haxelib repository path
  71.     newrepo   : create a new local repository
  72.     deleterepo: delete the local repository
  73.     convertxml: convert haxelib.xml file to haxelib.json
  74.     run       : run the specified library with parameters
  75.     proxy     : setup the Http proxy
  76.   Available switches
  77.     --flat    : do not use --recursive cloning for git
  78.     --always  : answer all questions with yes
  79.     --debug   : run in debug mode, imply not --quiet
  80.     --quiet   : print less messages, imply not --debug
  81.     --system  : run bundled haxelib version instead of latest update
  82.     --never   : answer all questions with no
  83.     --global  : force global repo if a local one exists
  84.  
  85. S:\Projects\Snip>haxelib install hxssl
  86. Downloading hxssl-3,0,0-alpha.zip...
  87. Download complete : 572177 bytes in 3s (184.5KB/s)
  88. Installing hxssl...
  89.   Current version is now 3.0.0-alpha
  90. Done
  91.  
  92. S:\Projects\Snip>haxe -lib hxssl --run Server
  93. C:\HaxeToolkit\haxe\lib\hxssl/3,0,0-alpha/sys/ssl/Socket.hx:68: characters 39-84 : You cannot use the library 'hxssl' inside a macro
  94. Aborted
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement