Binding proxy on custom port programmatically
In my extension i want to accept all requests on custom port (for example 1337). There is no actual server on my computer, just another tool in the Internet, which would send there requests. I thought about proxy listener, but didnt find, how to bind proxy on port inside my extension. Maybe there is a better way to do it (catch all requests on port 1337 programmatically)?
Do you mean you want to make your extension start a Burp Proxy listener on port 1337?
If so, you can use the loadConfigFromJson() API to load a fragment of a Burp config file:
To generate suitable config, you can manually create the settings you want in the Proxy listener UI, and then save a config file from that panel, using the options button (with the gear icon).