diff options
| author | Eugen Wissner <belka@caraus.de> | 2025-12-25 21:24:10 +0100 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2025-12-25 21:24:10 +0100 |
| commit | 4a7edf29cc192a039dbfd59960569f8c4f127992 (patch) | |
| tree | e5d17cc346048c7db528127b87e904f1a9c44620 /bin | |
| parent | 92ee723d139a9e1bdfd559464b716ba8f0714221 (diff) | |
| download | kazbek-4a7edf29cc192a039dbfd59960569f8c4f127992.tar.gz | |
Remove the mock server
There are better alternatives.
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/mock_server.rb | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/bin/mock_server.rb b/bin/mock_server.rb deleted file mode 100755 index b33eac6..0000000 --- a/bin/mock_server.rb +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env ruby -# This Source Code Form is subject to the terms of the Mozilla Public License, -# v. 2.0. If a copy of the MPL was not distributed with this file, You can -# obtain one at https://mozilla.org/MPL/2.0/. - -# frozen_string_literal: true - -require 'socket' -require 'json' - -TCP_PORT = 8082 - -server = TCPServer.new TCP_PORT - -puts "Provide some JSON and press Ctrl-D oder pipe the input via STDIN." -response = '' - -while input = gets do - response += input -end - -puts "Starting the server on #{TCP_PORT}." - -loop do - client = server.accept - - puts 'Connection accepted' - puts client.gets - - begin - client.print("HTTP/1.1 200 OK\r\n") - client.print("Content-Type: application/json\r\n") - client.print("Content-Length: #{response.bytesize}\r\n") - client.print("Connection: close\r\n") - client.print("\r\n") - - response.each_char do |chunk| - client.print chunk - sleep 0.1 - end - - # client.print(response) - end - - client.close -end |
