Created
October 8, 2022 20:13
-
-
Save sasha2002/60e8065343e1168c41f6233cd4258413 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ilsap - Intellij License Server Active Proxy | |
# | |
# Since Jetbrains started to blacklist license servers by hostname, it's being a pain in the ass | |
# to find a working one. So this is an active proxy for Intellij license servers, that masks | |
# a license server into your localhost. Just create a startup script to call ilsap, | |
# configure your IDE to activate from the localhost and YOLO! | |
# | |
require "http/server" | |
require "http/client" | |
host = "0.0.0.0" | |
port = 8997 | |
license_server = "xidea.online" | |
server = HTTP::Server.new(host, port, [HTTP::LogHandler.new]) do |context| | |
request = context.request | |
request.headers.delete("Host") | |
client = HTTP::Client.new(license_server) | |
response = client.get(request.resource, request.headers) | |
context.response.status_code = response.status_code | |
context.response.print(response.body) | |
end | |
puts "Listening on http://#{host}:#{port} <- Use this url to register your product" | |
server.listen |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment