About SimpleHTTPServer

2016-12-11 Thread Daniel Sun
Hi all, Does Groovy provide any function like Python's SimpleHTTPServer(e.g. python -m SimpleHTTPServer 8000)? If no similar module exits, I'd like to implement one via Groovy 3(e.g. groovy -m SimpleHTTPServer 8000). FYI: https://docs.python.org/2/library/simplehttpserver.html Cheer

Re: About SimpleHTTPServer

2016-12-11 Thread Balachandran Sivakumar
Hi, On Sun, Dec 11, 2016 at 01:02:23AM -0700, Daniel Sun wrote: > Hi all, > > Does Groovy provide any function like Python's SimpleHTTPServer(e.g. > python -m SimpleHTTPServer 8000)? If no similar module exits, I'd like to > implement one via Groovy 3(e.g. groovy -m SimpleHTTPServer 8000).

Re: About SimpleHTTPServer

2016-12-11 Thread Daniel Sun
Yeah, I think so too, but I'm not sure whether Groovy already has some similar function or not... Cheers, Daniel.Sun -- View this message in context: http://groovy.329449.n5.nabble.com/About-SimpleHTTPServer-tp5737191p5737196.html Sent from the Groovy Dev mailing list archive at Nabble.com.

Re: About SimpleHTTPServer

2016-12-11 Thread Jochen Theodorou
On 11.12.2016 09:02, Daniel Sun wrote: Hi all, Does Groovy provide any function like Python's SimpleHTTPServer(e.g. python -m SimpleHTTPServer 8000)? If no similar module exits, I'd like to implement one via Groovy 3(e.g. groovy -m SimpleHTTPServer 8000). FYI: https://docs.python

Re: Groovy Build

2016-12-11 Thread Jochen Theodorou
On 05.12.2016 07:37, Russel Winder wrote: I think the build for Groovy has changed since I last really looked at it. Just in case someone knows the answer offhand (to save me doing the research :-) since nobody bothered to answer so far. The build still distinguishes indy and non-indy build,

Re: About SimpleHTTPServer

2016-12-11 Thread Sébastien Le Callonnec
Hi Daniel, On 2016-12-11 08:02:23, Daniel Sun wrote: > Hi all, > > Does Groovy provide any function like Python's SimpleHTTPServer(e.g. > python -m SimpleHTTPServer 8000)? If no similar module exits, I'd like to > implement one via Groovy 3(e.g. groovy -m SimpleHTTPServer 8000). As a sepa

Re: About SimpleHTTPServer

2016-12-11 Thread Remi Forax
FYIW, there is already an httpserver with the jdk http://hg.openjdk.java.net/jdk9/jdk9/jdk/file/tip/src/jdk.httpserver/share/classes/com/sun/net/httpserver/package-info.java cheers, Rémi - Mail original - > De: "Daniel Sun" > À: d...@groovy.incubator.apache.org > Envoyé: Dimanche 11 D

Re: About SimpleHTTPServer

2016-12-11 Thread Daniel Sun
Hi Remi, Your reply is always so helpful :-) As far as I remember, Sun introduced the http server in Java6. It's lucky for us that it's included in the OpenJDK too. Cheers, Daniel.Sun -- View this message in context: http://groovy.329449.n5.nabble.com/About-SimpleHTTPServer-tp57

Re: About SimpleHTTPServer

2016-12-11 Thread Daniel Sun
Hi Jochen, Given we have a directory containing some web pages and want to access these pages via http protocal(e.g. we want to test WebRTC app), we have to run a httpserver to provide http service. In the past, we have to use Python to achieve the requirement because its SimpleHTTPServer i

Re: About SimpleHTTPServer

2016-12-11 Thread Daniel Sun
Hi Sébastien, The SimpleHTTPServer will be implemented with NO 3rd part library, so it will not impact existing production systems. In addition, it is recommended to be used to provide http service for convenience(such as testing WebRTC app). If we want to deploy our static web site, the Simp

Re: About SimpleHTTPServer

2016-12-11 Thread Paul King
I don't know whether you would find listing 12.16 from ReGinA useful: It is based on Jetty rather than com.sun.net.httpserver.HttpServer but might provide some useful inspiration: https://github.com/Dierk/GroovyInAction/blob/master/listings/chap12/Listing_12_16_GroovletExample.groovy Also, I don

Re: About SimpleHTTPServer

2016-12-11 Thread Paul King
I should have mentioned the above example is more about illustrating groovlets rather than serving up static content but it isn't too hard to switch between the two. On Sun, Dec 11, 2016 at 9:59 PM, Paul King wrote: > I don't know whether you would find listing 12.16 from ReGinA useful: > > It is

Re: About SimpleHTTPServer

2016-12-11 Thread Hubert Klein Ikkink
Hi, the following code snippet can be used as inspiration: https://github.com/mrhaki/groovyrun-gradle-plugin/blob/master/src/main/groovy/com/mrhaki/gradle/groovyrun/SimpleHttpServer.groovy It has no 3rd party dependencies and uses the Groovy socket support. Kind regards, Hubert Klein Ikkink >

Re: About SimpleHTTPServer

2016-12-11 Thread Daniel Sun
Hi Paul, The built-in httpserver of JDK suggested by Remi seems better for us, it is stable and does not require 3rd party library: http://hg.openjdk.java.net/jdk9/jdk9/jdk/file/tip/src/jdk.httpserver/share/classes/com/sun/net/httpserver/package-info.java As to hooking to the ex

Re: About SimpleHTTPServer

2016-12-11 Thread Cédric Champeau
Is it just me or Remi is advising to use a com.sun class? Le 11 déc. 2016 17:18, "Daniel Sun" a écrit : > Hi Paul, > > The built-in httpserver of JDK suggested by Remi seems better for us, > it is stable and does not require 3rd party library: > > http://hg.openjdk.java.net/jdk9/jdk9/jdk/f

Re: About SimpleHTTPServer

2016-12-11 Thread Daniel Sun
Thanks for your suggestion, mrhaki :) In order to avoid maintaining the httpserver, I'd like to use the built-in httpserver of JDK. Cheers, Daniel.Sun -- View this message in context: http://groovy.329449.n5.nabble.com/About-SimpleHTTPServer-tp5737191p5737213.html Sent from the Groovy Dev mail

Re: About SimpleHTTPServer

2016-12-11 Thread Daniel Sun
Hi Cédric, It is also available in the openjdk, any potential problem with it? http://hg.openjdk.java.net/jdk9/jdk9/jdk/file/tip/src/jdk.httpserver/share/classes/com/sun/net/httpserver/package-info.java Cheers, Daniel.Sun -- View this message in context: http://groovy.329449.n5.nabble.

Re: About SimpleHTTPServer

2016-12-11 Thread Remi Forax
There are com.sun classes and com.sun classes :) These ones are exported http://hg.openjdk.java.net/jdk9/jdk9/jdk/file/tip/src/jdk.httpserver/share/classes/module-info.java so ok to use. Said differently, they are not part of Java but part of the OpenJDK. Rémi > De: "Cédric Champeau" >

Re: About SimpleHTTPServer

2016-12-11 Thread Daniel Sun
That's great :) -- View this message in context: http://groovy.329449.n5.nabble.com/About-SimpleHTTPServer-tp5737191p5737216.html Sent from the Groovy Dev mailing list archive at Nabble.com.

Re: About SimpleHTTPServer

2016-12-11 Thread Sébastien Le Callonnec
Hi Daniel, On 2016-12-11 10:33:52, Daniel Sun wrote: > The SimpleHTTPServer will be implemented with NO 3rd part library, so > it will not impact existing production systems. In addition, it is > recommended to be used to provide http service for convenience(such as > testing WebRTC app). If

Re: Welcome to our new committer : Sergei Egorov

2016-12-11 Thread Roman Shaposhnik
Welcome Sergei -- great to have you part of the Apache Groovy club! Thanks, Roman. On Sat, Dec 10, 2016 at 1:55 AM, Sergei Egorov wrote: > Hi, the Apache Groovy people! > > I'm excited to join the team! Big thanks to PMC for this opportunity. > > I wrote my first Groovy code 3.5 years ago :) Was