Skip to content

Instantly share code, notes, and snippets.

@sasha2002
Created October 8, 2022 20:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sasha2002/60e8065343e1168c41f6233cd4258413 to your computer and use it in GitHub Desktop.
Save sasha2002/60e8065343e1168c41f6233cd4258413 to your computer and use it in GitHub Desktop.
# 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