class EL_IP_ECHO_SERVLET

(source code)

Client examples: COMPILED_CLASSES

description

Fast CGI IP echo servlet

note
	description: "Fast CGI IP echo servlet"

	author: "Finnian Reilly"
	copyright: "Copyright (c) 2001-2022 Finnian Reilly"
	contact: "finnian at eiffel hyphen loop dot com"

	license: "MIT license (See: en.wikipedia.org/wiki/MIT_License)"
	date: "2024-08-26 6:57:01 GMT (Monday 26th August 2024)"
	revision: "12"

class
	EL_IP_ECHO_SERVLET

inherit
	FCGI_HTTP_SERVLET
		redefine
			on_serve_done
		end

create
	make

feature {NONE} -- Basic operations

	serve
		do
			log.enter ("serve")
			log.put_labeled_string ("IP", request.parameters.remote_addr)
			log.put_new_line
			response.set_content (
				"Your IP address is: " + request.parameters.remote_addr, Text_type.plain, {EL_ENCODING_TYPE}.Latin_1
			)
			log.exit
		end

	on_serve_done
		do
			log.enter ("on_serve_done")
			across request.method_parameters as parameter loop
				log.put_labeled_string (parameter.key, parameter.item)
				log.put_new_line
			end
			log.exit
		end

end