packages feed

sws 0.3.1.1 → 0.3.1.2

raw patch · 3 files changed

+22/−14 lines, 3 filesdep ~filepathdep ~wai-middleware-staticdep ~warp

Dependency ranges changed: filepath, wai-middleware-static, warp, warp-tls

Files

CHANGELOG.md view
@@ -1,6 +1,11 @@ # Change Log All notable changes to this project will be documented in this file. +## 0.3.1.2 - 2015-08-25+### Changed+- Upper bound bumps.+- Make STUN server look up a bit more robust.+ ## 0.3.1.1 - 2015-04-17 ### Changed - Upper bound bump to support GHC 7.10.
Main.hs view
@@ -61,23 +61,26 @@ -- Not future things: CGI etc of any sort, "extensibility" -- vERSION :: String-vERSION = "0.3.1.1"+vERSION = "0.3.1.2"  -- STUN code -stunAddr :: Net.HostAddress-stunAddr = 0x7F4CC2AD --0xADC24C7F -- stun.l.google.com:19302 (173.194.76.127)+-- TODO: Make these parameters.+stunHost :: String+stunHost = "stun.l.google.com"  stunPort :: Net.PortNumber stunPort = 19302 -- Usually 3478  sendStun :: Net.Socket -> IO ()-sendStun s = Net.sendTo s bytes (Net.SockAddrInet stunPort stunAddr) >> return ()-    where bytes = BS.pack [0x00, 0x01, 0x00, 0x00, -- Type Binding, Size 0-                           0x21, 0x12, 0xA4, 0x42, -- Magic Cookie-                           0x00, 0x00, 0x00, 0x00, -- Transaction ID (should be cryptographically random-                           0x00, 0x00, 0x00, 0x00, -- and unique, but who cares?)-                           0x00, 0x00, 0x00, 0x00]+sendStun s = do+    [stunAddr] <- fmap (take 1 . hostAddresses) (getHostByName stunHost) -- TODO: maybe have an option to list all addresses+    Net.sendTo s bytes (Net.SockAddrInet stunPort stunAddr) >> return ()+  where bytes = BS.pack [0x00, 0x01, 0x00, 0x00, -- Type Binding, Size 0+                         0x21, 0x12, 0xA4, 0x42, -- Magic Cookie+                         0x00, 0x00, 0x00, 0x00, -- Transaction ID (should be cryptographically random+                         0x00, 0x00, 0x00, 0x00, -- and unique, but who cares?)+                         0x00, 0x00, 0x00, 0x00]      recvStun :: Net.Socket -> IO [Word8] recvStun s = do -- Assuming successful XOR-MAPPED-ADDRESS response.  See RFC5389. TODO: Don't assume so much.
sws.cabal view
@@ -10,7 +10,7 @@ -- PVP summary:      +-+------- breaking API changes --                   | | +----- non-breaking API additions --                   | | | +--- code changes with no API change-version:             0.3.1.1+version:             0.3.1.2  -- A short (one-line) description of the package. synopsis:            A simple web server for serving directories, similar to weborf.@@ -73,17 +73,17 @@     crypto-pubkey(==0.2.*),     crypto-random(==0.0.*),     directory(==1.2.*), -    filepath(==1.3.*), +    filepath >=1.3 && <1.5,      http-types(==0.8.*),      hourglass(==0.2.*),     network(==2.6.*),     pem(==0.2.*),     resourcet(==1.1.*),     transformers(==0.4.*),-    warp(==3.0.*), -    warp-tls >=3.0.1.2 && <3.1, +    warp >=3.0 && <3.2,+    warp-tls >=3.0.1.2 && <3.2,      wai(==3.0.*),-    wai-middleware-static(==0.6.*), +    wai-middleware-static >=0.6 && <0.8,      wai-extra >=3.0.3 && <3.1,     x509(==1.5.*)