--- title: "Scripting" menu: addons: weight: 5 --- # Scripting Sometimes, we would like to write a quick script without going through the trouble of creating a class. The addons mechanism has a shorthand that allows a module as a whole to be treated as an addon object. This lets us place event handler functions in the module scope. For instance, here is a complete script that adds a header to every request. {{< example src="examples/addons/scripting-headers.py" lang="py" >}} Here's another example that intercepts requests to a particular URL and sends an arbitrary response instead: {{< example src="examples/simple/send_reply_from_proxy.py" lang="py" >}} You can look at the [http][] module, or the [Request][], and [Response][] classes for other attributes that you can use when scripting. [http]: https://github.com/mitmproxy/mitmproxy/blob/master/mitmproxy/http.py [Request]: https://github.com/mitmproxy/mitmproxy/blob/master/mitmproxy/net/http/request.py [Response]: https://github.com/mitmproxy/mitmproxy/blob/master/mitmproxy/net/http/response.py elect> [no description]
aboutsummaryrefslogtreecommitdiffstats
path: root/lib/lufa/Projects/Webserver/Lib/DataflashManager.h
blob: 367fbac8c4572e53cbc1e12da20739166b1e1043 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87