Skip to content

Instantly share code, notes, and snippets.

Avatar

Matthias Danetzky mdanetzky

  • Warsaw, Poland
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am mdanetzky on github.
  • I am themaster (https://keybase.io/themaster) on keybase.
  • I have a public key whose fingerprint is 85F7 6F3A F037 0846 584C B001 5359 12BE D636 9C0D

To claim this, I am signing this object:

@mdanetzky
mdanetzky / SimpleHttpServer.java
Last active May 30, 2016
Simple http server in java. Fits one file. Perfect for test scenarios. Example: String url = SimpleHttpServer.getBuilder().setContent("my content").start();
View SimpleHttpServer.java
import com.sun.net.httpserver.*;
import javax.net.ssl.KeyManagerFactory;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLEngine;
import javax.net.ssl.TrustManagerFactory;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;