Class: WebSocket::HttpStaticFileServerHandler

Inherits:
SimpleChannelInboundHandler
  • Object
show all
Includes:
HeaderHelpers, HttpStaticFileServerHandlerInstanceMethods, ResponseHelpers, ValidationHelpers
Defined in:
lib/websocket/http_static_file_server_handler.rb

Overview

The HttpStaticFileServerHandler class supports classical file server semantics.

Constant Summary

Constants included from ValidationHelpers

ValidationHelpers::DOT_FILE_SEPARATOR_PATTERN, ValidationHelpers::FILE_SEPARATOR_DOT_PATTERN, ValidationHelpers::FORWARD_SLASH_PATTERN, ValidationHelpers::QUERY_STRING_PATTERN

Constants included from ResponseHelpers

ResponseHelpers::NON_SPACES_BEFORE_EOL_PATTERN

Constants included from HeaderHelpers

WebSocket::HeaderHelpers::PrivateMaxAgeTempalte

Constants included from HttpStaticFileServerHandlerInstanceMethods

WebSocket::HttpStaticFileServerHandlerInstanceMethods::FORWARD_SLASH_BEFORE_EOL_PATTERN, WebSocket::HttpStaticFileServerHandlerInstanceMethods::URI_FORWARD_SLASH_TEMPLATE

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ValidationHelpers

#insecure_uri?, #sanitize_uri

Methods included from ResponseHelpers

#index_listing, #send_error, #send_listing, #send_not_modified, #send_redirect

Methods included from HeaderHelpers

#cache_control_header, #content_type_header, #date_and_cache_headers, #date_header, #expires_header, #guess_content_type, #keep_alive_header, #last_modified_header

Methods included from HttpStaticFileServerHandlerInstanceMethods

#exceptionCaught, #messageReceived

Constructor Details

#initialize(options = nil) ⇒ HttpStaticFileServerHandler

Returns a new instance of HttpStaticFileServerHandler.



35
36
37
38
# File 'lib/websocket/http_static_file_server_handler.rb', line 35

def initialize(options = nil)
  super(FullHttpRequest.java_class)
  @options = options
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



33
34
35
# File 'lib/websocket/http_static_file_server_handler.rb', line 33

def options
  @options
end

Instance Method Details

#channelRead0(ctx, message) ⇒ Object

Please keep in mind that this method will be renamed to messageReceived(ChannelHandlerContext, I) in 5.0.

protected abstract void channelRead0(ChannelHandlerContext ctx, I msg) throws Exception



44
45
46
# File 'lib/websocket/http_static_file_server_handler.rb', line 44

def channelRead0(ctx, message)
  messageReceived(ctx, message)
end