Discuss Scratch
- Discussion Forums
- » Advanced Topics
- » mproto : python library for making custom web protocols
- ninjaMAR
-
Scratcher
1000+ posts
mproto : python library for making custom web protocols
In construction
About
Make custom web protocols such asRequires
pip
Information
I have included some protocols to test the program
Examples
Make a protocol
Use a default protocol
Urls
Notes
About
Make custom web protocols such as
test://INSERTDATAHERE
- python >=3.7 (I haven't tested on 3.6)
- pip (optional)
pip
pip3 install mproto
I have included some protocols to test the program
Examples
Make a protocol
from mproto import BaseProtoHandler import urllib.request as urlreq class MyProto(BaseProtoHandler): def myproto_open(self,req): #the function name should be protocol+_open #handles the request return req.get_full_url() myproto.install() print(urlreq.urlopen('myproto://abc')) #should output myproto://abc
from mproto.defaults import TestProto import urllib.request as urlreq TestProto.install() print(urlreq.urlopen('test://abc'))
Notes
- You can use mproto.install(*proto) to install instead of proto.install()
Last edited by ninjaMAR (May 19, 2021 21:11:53)
- PkmnQ
-
Scratcher
1000+ posts
mproto : python library for making custom web protocols
Seems interesting. Where can I see how to make it respond to requests?
Last edited by PkmnQ (May 20, 2021 17:09:27)
- ninjaMAR
-
Scratcher
1000+ posts
mproto : python library for making custom web protocols
Seems interesting. Where can I see how to make it respond to requests?Requests is build on urllib3 which is build on http.client. Since I use urllib for my code, I would need to switch to http.client somehow
- gdpr5b78aa4361827f5c2a08d700
-
Scratcher
1000+ posts
mproto : python library for making custom web protocols
neat
- Raihan142857
-
Scratcher
1000+ posts
mproto : python library for making custom web protocols
why do the stats seem false? how many people downloaded it?you
- gdpr5b78aa4361827f5c2a08d700
-
Scratcher
1000+ posts
mproto : python library for making custom web protocols
why do the stats seem false? how many people downloaded it?if people are using it in replit, then it'll download every time the repl starts.
- PkmnQ
-
Scratcher
1000+ posts
mproto : python library for making custom web protocols
Ok, then what can I use this for?Seems interesting. Where can I see how to make it respond to requests?Requests is build on urllib3 which is build on http.client. Since I use urllib for my code, I would need to switch to http.client somehow
- ninjaMAR
-
Scratcher
1000+ posts
mproto : python library for making custom web protocols
Use it to make custom url protocols. I could try to switch to http.client somehowOk, then what can I use this for?Seems interesting. Where can I see how to make it respond to requests?Requests is build on urllib3 which is build on http.client. Since I use urllib for my code, I would need to switch to http.client somehow
- Discussion Forums
- » Advanced Topics
-
» mproto : python library for making custom web protocols



