Skip to content

Conversation

@rr83019
Copy link
Contributor

@rr83019 rr83019 commented Apr 3, 2021

Solves #66

rr83019 added 5 commits April 3, 2021 23:08
Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>
Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>
Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>
Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>
Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>
@rr83019 rr83019 requested a review from hrj April 3, 2021 17:52
Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>
@hrj
Copy link
Contributor

hrj commented Apr 6, 2021

The following is a good replacement for fibry for now:

import com.sun.net.httpserver.HttpServer 
import java.net.InetSocketAddress

...

        val server = HttpServer.create(new InetSocketAddress(port), 32)                                                                                                  

        server.createContext("/", ex => {
            val response = "Hi there!";                                                                                                                                  
            val bytes = response.getBytes()
            try {
              ex.sendResponseHeaders(200, bytes.length);//response code and length
              val os = ex.getResponseBody();
              os.write(bytes);
              os.close();                                                                                                                                                
            } catch {                                                                                                                                                    
              case e: Exception =>
                println("exception: " + e)
            }
        });
        server.start()

rr83019 added 3 commits April 11, 2021 16:05
Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>
Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>
Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>
@rr83019 rr83019 requested a review from hrj April 11, 2021 10:40
Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>
Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>
@hrj hrj changed the title Migrate to Fibry Migrate to HttpServer Apr 11, 2021
@hrj hrj merged commit 4612dfa into librecaptcha:master Apr 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants