Module: Watobo::Interceptor
Overview
Defined Under Namespace
Modules: Transparent
Classes: Carver, CarverRule, Filter, FilterChain, FlagFilter, HttpParmsFilter, MethodFilter, Proxy, RequestCarver, RequestFilter, ResponseCarver, StatusFilter, UrlFilter
Constant Summary
collapse
- INTERCEPT_NONE =
0x00
- INTERCEPT_REQUEST =
0x01
- INTERCEPT_RESPONSE =
0x02
- INTERCEPT_BOTH =
0x03
- REWRITE_NONE =
0x00
- REWRITE_REQUEST =
0x01
- REWRITE_RESPONSE =
0x02
- REWRITE_BOTH =
0x04
- INTERCEPT_DEFAULT_PORT =
8081
- MODE_REGULAR =
0x01
- MODE_TRANSPARENT =
0x02
Class Method Summary
collapse
Class Method Details
.active? ⇒ Boolean
74
75
76
77
|
# File 'lib/watobo/core/interceptor.rb', line 74
def self.active?
return false if @proxy.nil?
return true
end
|
.intercept_mode ⇒ Object
41
42
43
|
# File 'lib/watobo/core/interceptor.rb', line 41
def self.intercept_mode
@intercept_mode
end
|
.intercept_mode=(mode) ⇒ Object
45
46
47
|
# File 'lib/watobo/core/interceptor.rb', line 45
def self.intercept_mode=(mode)
@intercept_mode = mode
end
|
.intercept_requests? ⇒ Boolean
54
55
56
57
|
# File 'lib/watobo/core/interceptor.rb', line 54
def self.intercept_requests?
return true if ( @intercept_mode & INTERCEPT_REQUEST ) > 0
return false
end
|
.intercept_responses? ⇒ Boolean
59
60
61
62
|
# File 'lib/watobo/core/interceptor.rb', line 59
def self.intercept_responses?
return true if ( @intercept_mode & INTERCEPT_RESPONSE ) > 0
return false
end
|
.proxy ⇒ Object
89
90
91
|
# File 'lib/watobo/core/interceptor.rb', line 89
def self.proxy
@proxy
end
|
.proxy_mode ⇒ Object
25
26
27
|
# File 'lib/watobo/core/interceptor.rb', line 25
def self.proxy_mode
@proxy_mode
end
|
.proxy_mode=(mode) ⇒ Object
29
30
31
|
# File 'lib/watobo/core/interceptor.rb', line 29
def self.proxy_mode=(mode)
@proxy_mode = mode
end
|
.rewrite_mode ⇒ Object
33
34
35
|
# File 'lib/watobo/core/interceptor.rb', line 33
def self.rewrite_mode
@rewrite_mode
end
|
.rewrite_mode=(mode) ⇒ Object
37
38
39
|
# File 'lib/watobo/core/interceptor.rb', line 37
def self.rewrite_mode=(mode)
@rewrite_mode = mode
end
|
.rewrite_requests? ⇒ Boolean
64
65
66
67
|
# File 'lib/watobo/core/interceptor.rb', line 64
def self.rewrite_requests?
return true if ( @rewrite_mode & REWRITE_REQUEST ) > 0
return false
end
|
.rewrite_responses? ⇒ Boolean
69
70
71
72
|
# File 'lib/watobo/core/interceptor.rb', line 69
def self.rewrite_responses?
return true if ( @rewrite_mode & REWRITE_RESPONSE ) > 0
return false
end
|
.start ⇒ Object
79
80
81
82
83
84
85
86
87
|
# File 'lib/watobo/core/interceptor.rb', line 79
def self.start
@proxy = Watobo::Interceptor::Proxy.start()
puts "DEBUG: Proxy running" if $DEBUG
end
|
.stop ⇒ Object
93
94
95
96
|
# File 'lib/watobo/core/interceptor.rb', line 93
def self.stop
@proxy.stop
@proxy = nil
end
|
.transparent? ⇒ Boolean
49
50
51
52
|
# File 'lib/watobo/core/interceptor.rb', line 49
def self.transparent?
return true if ( @proxy_mode & MODE_TRANSPARENT ) > 0
return false
end
|